code_junkie

How can I run a program from a batch file without having the console open after the program start?

Nov 12th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. myprogram.exe param1
  2.  
  3. start myProgram.exe param1
  4. exit
  5.  
  6. START rest-of-your-program-name
  7.  
  8. @echo off
  9. notepad c:test.txt
  10.  
  11. @echo off
  12. start notepad c:test.txt
  13.  
  14. start "name" /B myprogram.exe param1
  15.  
  16. start /b myProgram.exe params...
  17.  
  18. wscript.exe invis.vbs myProgram.exe %*
  19.  
  20. set args = WScript.Arguments
  21. num = args.Count
  22.  
  23. if num = 0 then
  24. WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
  25. WScript.Quit 1
  26. end if
  27.  
  28. sargs = ""
  29. if num > 1 then
  30. sargs = " "
  31. for k = 1 to num - 1
  32. anArg = args.Item(k)
  33. sargs = sargs & anArg & " "
  34. next
  35. end if
  36.  
  37. Set WshShell = WScript.CreateObject("WScript.Shell")
  38.  
  39. WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False
Add Comment
Please, Sign In to add comment