cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with wScript.Shell

Highlighted
Occasional Contributor

Trouble with wScript.Shell

Hello,

I'm trying to shell out to one of our tested apps with the following script:




Sub StartE2Shop()


  dim objShell


  Set objShell = Sys.OleObject("WScript.Shell")


 


  objShell.Run("cmd /c cd\LabAutomation\Build & C:\LabAutomation\Build\E2SS_Shop_Gatekeeper.exe |Time_And_Attendance_001 | TC12TA |66")


 


  Set objShell = Nothing


 


End Sub



The problem stems from the method used to pass parameters to the app.  If I leave out the parameters, the app starts as it should, but throws an error that it doesn't have the data it needs to run (as it should).  When I include the parameters as written above the line executes without error, but nothing happens.  The app does not start.



thanks,

Mike Smith


 

1 REPLY 1
Highlighted
Valued Contributor

RE: Trouble with wScript.Shell

Set objShell = CreateObject("wScript.Shell")

objShell.Run("cmd /c ""my path with spaces here""")




''-Praise the sun and Give Kudos.''
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors