'Create Shell Object
set oExec =nothing
set shell = nothing
Set shell = CreateObject("wscript.shell")
'Execute command Prompt(DOS) to get current username
'Execute command Prompt(DOS) to get current username
Set oExec = shell.Exec("cmd.exe /c echo %username%")
'Print All output
msgbox oExec.Stdout.ReadAll'Print All output
set oExec =nothing
set shell = nothing
OUTPUT
=======
Current username will get displayed
No comments:
Post a Comment