This is a batch file in Windows.
Here is my .bat file
@echo off
copy "C:\Remoting.config-Training" "C:\Remoting.config"
"C:\ThirdParty.exe"
This works fine except the .bat file leaves the command window open the whole time the "ThirdParty" application is running.
I need the command window to close.
I would use the short-cut for the application but I must be able to run this copy command first (it actually changes which data base and server to use for the application).
The ThirdParty application does not allow the user to change the source of the db or the application server.
We're doing this to allow users to change from a test environment to the production environment.
run it under a different user. assuming this is a windows box, create a user account for scheduled tasks. run it as that user. The command prompt will only show for the user currently logged in.
To make the command window of a .bat file that executes a .exe file exit out as fast as possible, use the line
@start
before the file you're trying to execute. Here is an example:(insert other code here) @start executable.exe (insert other code here)
You don't have to use other code with
@start executable.exe
.Or you can use :
Start /d "the directory of the executable" /b "the name of the executable" "parameters of the executable" %1
( %1 is if a file, is passed to your executable, for example, notepad.exe foo.txt, here %1 is "foo.txt".The /b parameters of the start command does this : "Starts an application without opening a new Command Prompt window. CTRL+C handling is ignored unless the application enables CTRL+C processing. Use CTRL+BREAK to interrupt the application." Which is exactly what we want.
Create a
.vbs
file with this code:This
.vbs
will runyour_batch.bat
hidden.Works fine for me.
Great tip. It works with batch files that are running a java program also.
Try this: