Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

start powershell script from vbscript

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Gents, i am trying to start a powershell script from a WshShell.Run command in vbscript.
the script I am trying to run has white space in the path to the where the powershell script is located.
i know i can just copy the powershell script locally to a folder with no white space but it doesnt seem to be the point.

i have tried

%systemdrive%\system32\windowspowershell\v1.0\powershell.exe 'c:\tools\power shell\script.ps1'

%systemdrive%\system32\windowspowershell\v1.0\powershell.exe "c:\tools\power shell\script.ps1"

%systemdrive%\system32\windowspowershell\v1.0\powershell.exe ^&'c:\tools\power shell\script.ps1'

%systemdrive%\system32\windowspowershell\v1.0\powershell.exe &'c:\tools\power shell\script.ps1'

i am not having any luck....

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
typical, the &' works, i just had "; exit $LASTEXITCODE" tagged onto the end which is didnt like.
you cant blame me, i didnt write this, just stuck with 'test week' and have been asked to debug an issue

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top