Windows BBS The Place for Microsoft Windows Support! Windows, Support, Help Site

Go Back   Windows BBS > Operating Systems > Windows 95/98/Me/NT

Windows 95/98/Me/NT Post your Windows 95 / 98 / ME and NT questions here. Please make sure you specify your OS version.

Register your FREE account to unlock additional features at WindowsBBS.com
Register
Welcome to WindowsBBS.com
Microsoft Windows Support

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.


Discussion Forums
Operating Systems
Windows 7 Windows 7
Windows Vista Windows Vista
Windows XP Windows XP
Windows Server System Windows Server System
Windows 2000 Windows 2000
Windows 95/98/Me/NT Windows 95/98/Me/NT
Internet & Networking
Networking
Internet Explorer
Microsoft Mail
Firefox, Thunderbird
      & SeaMonkey

General Internet
Security
General Security
Malware and Virus
     Removal

Other
Other Software
Hardware
Test Posts
Community
Introductions
General Discussions
Comments
      & Suggestions

News @ WindowsBBS

Closed Thread
 
LinkBack Thread Tools
Old 27th March 2004   #1
Inactive
 
Profile:
Join Date: Sep 2003
Posts: 199
Computer Experience:
experienced
rlambert7 Reputation Level


How make batch job window close

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

rlambert7 is offline  
Didn't find the information you thought to find?
Check out these Similar Threads
Old 27th March 2004   #2
Inactive
 
Profile:
Join Date: Jan 2002
Location: Albuquerque, NM, USA
Posts: 5,747
Computer Experience:
still learning
Welshjim Reputation Level


Tab down a line from the present end of the .bat file and type cls, then click File| Save
Welshjim is offline  
Old 28th March 2004   #3
Inactive
 
Profile:
Join Date: Sep 2003
Posts: 199
Computer Experience:
experienced
rlambert7 Reputation Level


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.

-Richard

rlambert7 is offline  
Old 28th March 2004   #4
WindowsBBS Team Member
 
markp62's Avatar
 
Profile:
Join Date: May 2002
Location: Coppell, TX
Posts: 3,854
Computer Experience:
Experimediate
markp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Levelmarkp62 Reputation Level


Add this as the final command.
exit

markp62 is offline  
Old 28th March 2004   #5
Inactive
 
Profile:
Join Date: Sep 2003
Posts: 199
Computer Experience:
experienced
rlambert7 Reputation Level


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!

rlambert7 is offline  
Old 28th March 2004   #6
Inactive
 
Profile:
Join Date: Jan 2003
Posts: 1,111
Computer Experience:
par
merlin Reputation Level


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

merlin is offline  
Old 28th March 2004   #7
Inactive
 
Profile:
Join Date: Nov 2003
Location: LosAngeles
Posts: 83
Computer Experience:
-
jubalsams Reputation Level


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.
jubalsams is offline  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 13:43.






Advertisements do not imply our endorsement of the product or service advertised.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 2002 - 2009 WindowsBBS.com. All rights reserved.
Terms of Use, Legal Information & Privacy Policy
[]