I want to run a bat file in background. I searched in google and I found some examples using hstart and cmdow. But Isn't anyway to do this with windows commands? I really feal good when I don't add extra programs to my project ! thanx in advance
Run batch file minimized from Windows Task Scheduler But if you want to run it minimized, then you have to make adjustments in the Actions tab. “^& exit” at the end is necessary to close the CMD window after the batch file is executed.
If you want to run additional commands while a previous command runs, you can run a command in the background. If you know you want to run a command in the background, type an ampersand (&) after the command as shown in the following example. The number that follows is the process id.
I'm using window scheduler. I found a way :
Save this one line of text as file invisible.vbs:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
To run any program or batch file invisibly, use it like this:
wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"
thanx
It really depends on the programming language and platform you are using.
In Windows, using the C# language on the .NET platform, it is:
System.Diagnostics.Process.Start(@"C:\myfile.bat");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With