vbscript - Get user's input and run command line -
when paste username in box, script open command line , run command user's information.
strinput = inputbox("prompt") dim oshell set oshell = wscript.createobject ("wscript.shell") oshell.run "cmd net1 user &inputbox /domain" set oshell = nothing i have tried above, doesn't seem work. please me out.
you want use /k switch, tells cmd execute command listed. in addition, need pull strinput variable out of quotes:
strinput = inputbox("prompt") dim oshell set oshell = wscript.createobject ("wscript.shell") oshell.run "cmd /k net1 user " & strinput & " /domain" set oshell = nothing
Comments
Post a Comment