Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AUTOMATICALLY CLOSE BATCH FILE!!! 3

Status
Not open for further replies.

SPYDERIX

Technical User
Jan 11, 2002
1,899
CA
Hi,

How do I close this batch file automatically when it's finished.

This is my batch file for deleting tif, cookies, etc.
------------------------
cddeltree/y temp
cd windows
deltree/y cookies
deltree/y history
deltree/y temp
deltree/y win386.swp
cd recent
DELTREE /y c:\windows\recent\*.* > NUL
cdcd windows
cd tempor~1
deltree/y content.ie5
cdcd windows
md temp
---------------------

I want the batch file to close automatically when the batch file finishes. I have tried putting exit at the end, but that didn't work. I'm using Windows ME.

Thanks
[deejay]
Nate
"If you're not living on the edge, you're taking up too much space!"
 
Ok, I have got this to work. I've added an extra line and modified another line b/c my T.I.F.'s aren't in C:\WINDOWS, I moved them to C:\ now it works. All I wanted to accomplish is to have this run every Monday Morning along with my other scheduled tasks, to keep my computer is good shape. Now that I've fixed the folder location problem, it works, and I don't want it to run at start-up.

Thanks for all the advise, problem solved! :)
colorado.gif
"Quest for the Cup - 2002!"​
 
To DellComputerUser:

On April 23, you indicated that you wanted this batch to run from the AUTOEXEC.BAT file. The AUTOEXEC.BAT file is like the fourth or fifth file to run (io.sys, msdos.sys, command.com, config.sys, then autoexec.bat--if I'm not mistaken) when your computer [red]"Starts up"[/red] and before WINDOWS opens.

Maybe everyone here was being presumptuous, including me, but that's what we had interrupted. We're all glad you were able to resolve your problem(s).

Happy computing. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Sorry, at first I wanted to just have it close, then b/c it wasn't working, it was suggested that I put it in autoexec.bat, but then learned that that wasn'
t a good idea, then I figured out why it wasn;t working b/c of T.I.F. being in the new folder. Hope this clears things up a bit.
colorado.gif
"Quest for the Cup - 2002!"​
 
That's ok. Sometimes one problem is solved and another arises. While other times we are too close to the problem and have to step back (or worse--start over [cry])

Speaking for myself, I was not insulted. And as I said, "glad you were able to resolve your problem(s)."
--MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
I have a batch program that I run to shutdown my computer (Win98SE). It does a lot of stuff including backups and purging temporary files, and also deletes the win286.swp file just before issuing the shutdown command. The command line to delete the swap file (on my d: partition) is:
"C:\WINDOWS\COMMAND\deltree /y d:\win386.swp\" sans quotes.
In this way the swap file is deleted at shutdown, and the system reinstates it at startup. I have a shortcut to the batch file which brings it up in MS-DOS prompt mode. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top