Passing Variables to VBS script RRS feed

  • Question

  • Hi,

    I have a vbs script containing

    Set objShell = CreateObject("Wscript.Shell")
    set ConvertFilename = WScript.Arguments(0)
    set ConvertDirectory = WScript.Arguments(1)
     objShell.Run ("powershell.exe -noexit c:\temp\myscript.ps1 ConvertFilename ConvertDirectory")

    which passes variables to a powershell script.

    However when i try to use the run command on the start menu using 

    c:\temp\test.vbs c:\temp\book5.xlsx c:\temp

    it does not seem to pick up the variables.

    Any help appreciated

    Thursday, May 3, 2018 2:14 PM

All replies