在VBScript中调用PowerShell脚本

时间:2016-06-21 09:24:26

标签: powershell vbscript

嗨,有人请帮我从vbscript作为管理员运行PowerShell

VB脚本

MyPath =“c:\ temp \ folder1” 昏暗的objShell 设置objShell = CreateObject(“Wscript.Shell”) objShell.run(“powershell.exe -noexit -file C:\ temp \ power.ps1”& MyPath)

PowerShell power.ps1

C:\ temp \ psfile.exe $ args [0] -c

1 个答案:

答案 0 :(得分:0)

在VBScript中Set用于对象;所以改变

set input ="C:\temp\folder1\"

input = "C:\temp\folder1\"