Invoke/Start PowerShell Script using .VBS script

The idea was to call any powershell script (.ps1),  located in the same folder as that .vbs script:

Code:

Dim sCurPath
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
'WScript.Echo sCurPath

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe –noexit &'" & sCurPath & "\SomeScript.ps1'")

I hope it helps someone.

Tags: , , ,

Locations of visitors to this page