|
Answer» I want to create a batch FILE that copies some files, then starts a windows program. Once the windows program starts, I would like for the cmd.exe window to close.
The last command in my batch file is the executable to the windows program and it doesn't go any further than that.
Any help would be appreciated.
Thanks.Code: [Select] @echo off copy %0 "C:\" start calc exit Code: [Select]
this copys this file into c drive then starts calculator then exits there is the basic thing just change the stuff you need to doI don't understand the %0 command. Can some explain.
P.s. I am new to Batch (i am a noob) :-/Hi Gabby Ab,
Please do a little homework about Batchprogramming: This is a very good Website:
http://www.robvanderwoude.com/index.html
%0 is the name of the Batchfile you start %1 is the FIRST PARAMETER if you TYPE one %2 the second and so on
hope this helps uliThanks Uli, I shall do some good READING now. I was only introduced to batch through this website and have since been very interested in its capabilities.To answer your first question.
You have to open a child process for the executable in mind. This can be done in DOS.
using CMD /C options...
CMD.EXE /c START CMD.EXE /c "PROGRAM.EXE"
This causes the program to run separetly from the parent. AKA=child process.
The command prompt will return to the parent program whilst the child is doing its on thing. Here is where you add your exit command. using windows xp professional, this is the command line that i use
start c:\progra~1\jascso~1\paints~1\psp.exe exit
it works great, you can have it copy what file you wish to above those lines, and then start and the destination of the file, and it automatically goes back to the batch file to finish what it was doing....
|