Windows 95/98/Me/NTPost your Windows 95 / 98 / ME and NT questions here. Please make sure you specify your OS version.
Mission Statement
WindowsBBS is an online community dedicated to easily accessible technical support for those using Microsoft operating systems and other Windows software.
Our goal is to become the leading resource for computer users that require assistance with their day-to-day computer usage, including full support for networking PC's, virus & malware removal, system upgrades and general support questions.
I wrote a short .BAT file that I wanted to have run via the Windows Scheduler. First time I ran it the DOS (or COMMAND) window appeared, and in the top of the window it said, "Finished".
I'm almost certain that, in the past, I've been able to write .BAT scripts that were run by the scheduler that "disappeared" after they completed.
I looked at the properties of the .BAT file, and, under the Program tab, I noticed a box called "Close on exit", that was not checked. I thought, "Ah, hah!", and checked it, but the DOS/COMMAND window still hangs around after the scheduled job completes, and I have to close it myself.
Hmm, maybe the "close" in the "close on exit" does not mean "close", as in "close the door", but "close" as in "close, but no cigar.
I also noticed that after having checked the "Close on exit" box that a new, .PIF, file, that pointed to the .BAT file, was created. So, I thought perhaps I needed to use the .PIF file as the file I would schedule instead of the .BAT file. I tried that, but the icon that gets put in the Scheduler window after I create the job looks like the .BAT file icon, and not the .PIF file icon.
Anyway, how do I get the batch job window to go away all by itself once it has completed?
Thank you.
-Richard
Didn't find the information you thought to find? Check out these Similar Threads
Thanks. I tried that, but I still have the window when the job finishes. I looked up "dos cls command" in a search engine, and it said that "cls" clears the window, and leaves only a prompt. That seemed to be the case when I used it.
Alas, I had already tried that. Window still hangs around with, or without, the "exit", with or without the "cls", and with or without the two of them.
...wrestle, wrestle, wrestle...
OK, I think I've got it. I had mentioned that when I checked the "close on exit" box, under the "Program" tab under "Properties" of the .BAT file, another file was greated, a .PIF file. However, if I selected the .PIF file via the scheduler, the original .BAT file was placed in the schedule, not the .PIF file. Windows knows best, right? So, I tried directly double-clicking on the .BAT file to run it. When I did that, it ran, but the window remained. Next, I directly double-clicked on the .PIF file. It ran, and the window disappered when it is finished. Hmm, interesting.
So, I went back to the scheduler, and selected "properties" for the job in question. In the "Run:" box I replaced the name of the .bat file with the .pif file, and ta-da! But SHEESH!
Do not run the .bat file but the .pif file that is automatically
created to run it - same as a shortcut.
Right click the .pif file to select what behaviour you want -
minimised, close on Exit and so on.
regards
I find that they close when i don't want them to close so i have to put a PAUSE at the end of the .bat calling with a pif. Maddening !
OOPS: i'm talking about the bats in NT class. Confusing. i try running the same bats in 9x and NT and they act different.
Last edited by jubalsams; 28th March 2004 at 13:27.