VBS脚本中给cmd传参

 

dim  wshell,UserName,Password
UserName = "aa3"
set wshell=createobject("wscript.shell")
msgbox(UserName)
wshell.run "powershell.exe d:\a.ps1 "&UserName&" " ,vbhide
dim wshell,username
username = inputbox("请输入域账号:")
msgbox username 

set wshell=createobject("wscript.shell")
wshell.run "net localgroup administrators "&username&" /add" ,vbhide

 

posted on 2020-11-19 10:26  momingliu11  阅读(588)  评论(0编辑  收藏  举报