各位大侠,求助如下的一段代码,runas 运行 notepad没有问题,可是放上需要运行的程序的绝对路径就不行了,但是如果手动在CMD下敲入含有绝对路径的命令行运行又没有问题,能帮看看是需要怎么修改吗?多谢啦
dim WshShell,cmd
cmd="%SystemRoot%\system32\cmd.exe"
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run cmd
WScript.Sleep 500
WshShell.SendKeys"runas /user:pldd\administrator ""C:\1\1.exe"""(这里如果是"runas /user:pldd\administrator notepad"就可以)
WshShell.SendKeys"{ENTER}"
WScript.Sleep 3000
WshShell.SendKeys"Password"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 3000
WshShell.SendKeys"%2"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 500
WshShell.SendKeys"exit"
WshShell.SendKeys"{ENTER}"
dim WshShell,cmd
cmd="%SystemRoot%\system32\cmd.exe"
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run cmd
WScript.Sleep 500
WshShell.SendKeys"runas /user:pldd\administrator ""C:\1\1.exe"""(这里如果是"runas /user:pldd\administrator notepad"就可以)
WshShell.SendKeys"{ENTER}"
WScript.Sleep 3000
WshShell.SendKeys"Password"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 3000
WshShell.SendKeys"%2"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 500
WshShell.SendKeys"exit"
WshShell.SendKeys"{ENTER}"