【发布时间】:2016-02-17 23:58:03
【问题描述】:
我需要通过 vbscript(cscript.exe) 在静默模式下运行 powershell 脚本。
脚本的基本步骤如下。
vbscript
WScript.StdOut.WriteLine "Welcome..."
WScript.StdOut.WriteLine "First Step..."
WScript.Sleep Int(2000)
Set objShell = CreateObject("Wscript.Shell"): objShell.Run "powershell -nologo -file D:\basic\child.ps1" ,0,true
WScript.StdOut.WriteLine "Script Completed."
WScript.Sleep Int(5000)
powershell 脚本
Write-Host "Some Text Printed"
Start-Sleep -s 2
此时,我喜欢将 powershell 脚本写入 vbscript(cscript.exe) 控制台。
我正在运行如下的 vb 脚本。
cscript d:\basic\script.vbs
是否有解决此要求的方法。
【问题讨论】:
标签: powershell vbscript powershell-2.0 windows-scripting