How to get username with vbs

后端 未结 4 775
遥遥无期
遥遥无期 2020-12-10 13:56

So i\'m trying to move a .vbs file with .movefile line and i want to give the .vbs to me friends but in order it to work I would have to know what their username is. what wo

4条回答
  •  有刺的猬
    2020-12-10 14:11

    Copy and paste this code:

    Set wshShell = CreateObject( "WScript.Shell" )
    User = wshShell.ExpandEnvironmentStrings( "%USERNAME%" )
    WScript.Echo "User: " & strUserName
    

提交回复
热议问题