For the moment my batch file look like this:
myprogram.exe param1
The program start but the Dos Windows still open... how can I close it?
For the moment my batch file look like this:
myprogram.exe param1
The program start but the Dos Windows still open... how can I close it?
You can use the exit keyword. Here is an example from one of my batch file:
start myProgram.exe param1
exit
Look at the START command, you can do this:
START rest-of-your-program-name
For instance, this batch-file will wait until notepad exits:
@echo off
notepad c:\test.txt
However, this won't:
@echo off
start notepad c:\test.txt
You should try this. It starts the program with no window. It actually flashes up for a second but goes away fairly quickly.
start "name" /B myprogram.exe param1
From my own question:
start /b myProgram.exe params...
works if you start the program from an existing DOS session.
If not, call a vb script
wscript.exe invis.vbs myProgram.exe %*
The Windows Script Host Run() method takes:
Here is invis.vbs:
set args = WScript.Arguments
num = args.Count
if num = 0 then
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
WScript.Quit 1
end if
sargs = ""
if num > 1 then
sargs = " "
for k = 1 to num - 1
anArg = args.Item(k)
sargs = sargs & anArg & " "
next
end if
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False