0

I'm trying to put a .bat file in my startup folder so it will run code when my computer starts up, but I don't want to see it. The batch file runs an .exe file with arguments. I was using this code in a .vbs script.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Test\My.bat" & Chr(34), 0
Set WshShell = Nothing

When I run it, it calls the .bat file and the bat file doesn't run the .exe with the parameters. Why is this? When I run just the .bat file, it calls the .exe just fine. I would appreciate it if someone could tell me how I could edit the code to make it work.

Hennes
  • 64,768
  • 7
  • 111
  • 168
ddos
  • 1
  • Possible Duplicate: https://superuser.com/questions/413939/how-to-start-a-program-with-command-line-arguments-on-windows-cmd-with-start – HashHazard Nov 01 '16 at 01:03

1 Answers1

0

Check out the use of the START command as illustrated in this question. The first answer in that question has more details, but here is the simple answer:

start /b "" "c:\Path\To\Your\Program.exe" -arguments
HashHazard
  • 183
  • 4