Windows脚本文件:功能与使用指南
1. 运行脚本示例
首先来看一个运行脚本的示例,以下是 RunOSInfo.vbs 脚本的代码:
Dim objShell
strCmd="wscript"
strScript="listing3-3.wsf"
strParams="/server:* /username:* /password:* /log:True"
Set objShell=CreateObject("WScript.Shell")
objShell.Run strCmd & " " & strScript & " " & strParams,1,False
WScript.Quit
当管理员双击此脚本时,会使用通配符作为参数值调用WSF脚本。WSF脚本会根据其代码提示用户输入所有必要的值。例如:
If strSrv="*" Then
strSrv=InputBox("What computer do you want to query?",strTitle,_
objNetwork.ComputerName)
If strSrv="" Then WScript.Quit
End If
'skip getting alternate credentials if Server is local system
If UCase(strSrv)<>UCase(objNetwork.Comp
超级会员免费看
订阅专栏 解锁全文


被折叠的 条评论
为什么被折叠?



