1

谁能帮我从批处理文件中执行vbs?我正在尝试执行此操作

''''Script to create manual system restore point without user intervention''''

If WScript.Arguments.Count = 0 Then

Set objShell = CreateObject("Shell.Application")

objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " Run", , "runas", 1

Else

GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "ManualRestorePoint", 0, 100

End If
4

1 回答 1

2

如果将上述脚本另存为myscript.vbs,则可以从批处理文件中将其调用为wscript myscript.vbs.

您可能想运行wscript /?以查看是否要传递任何标志来抑制横幅等。

于 2013-11-09T17:02:55.013 回答