Can u run a TSR type program in WinXP ?

  • Thread starter Thread starter Bubey
  • Start date Start date
B

Bubey

Is there a way I can get "Disk Cleanup" to run at
shutdown?
i.e., when I shut down for the day, have Disk
Cleanup run,
and then the PC shuts off..............TNX
 
Kindof. You can make yourself a shortcut on your desktop (or anywhere you
want) that automatically runs the disk cleanup then shuts down your computer.
You have to make the batch file yourself. Here's how:

First, go to start > Run and type this:
cleanmgr /sageset:150

That number (150) can be anything you want up to 65500 or something. But
remember what number you chose.
That will open a dialog to let you choose what you want it to clean
everytime you run the automatic-cleanup-command (I'll get to that in a sec).
You may not want it to automatically empty the recycle bin at every shutdown,
because it might erase something you'd want to recover when you turn the
computer back on. Just a thought.

Anyway after you set those options, OK that dialog.

Then, open up good old trusty Notepad. Type this on the first line:
cleanmgr /sagerun:150

That will run the cleanup using the settings you stored to the 150 number
(or whatever number you used above). On the next line, put:

shutdown.exe -s -t 0

The t 0 (zero) part is how many seconds to show the "system is about to
shutdown" box. If you use 0 (zero), it will happen immediately. If you want
it to force-quit programs that might be waiting to shutdown, like a program
that's still asking "do you want to save?" just add -f (for force) to the
command line, like this:

shutdown.exe -s -t 0 -f

So your notepad file should look like this:
-----------------------
cleanmgr /sagerun:150
shutdown.exe -s -t 0 -f
-----------------------

If you want to be fancy, you can add a few commands to it to make the dialog
look neat when you run it, like:
-----------------------
ECHO OFF
TITLE Pre-shutdown clean-up in progress...
CLS
ECHO Please wait while I run disk cleanup.
ECHO The computer will turn off as soon as cleanup is complete.
cleanmgr /sagerun:150
shutdown.exe -s -t 0 -f
-----------------------
That will turn off the messages (echo off), set the DOS window title to
"Pre-shutdown clean-up in progress..." (instead of c:\windows\cmd.exe), then
it will show those two lines of text in thd DOS window while it's working.


The last part, save the file. Go to File > Save As, but before you
save--change the file type drop-down to "all files". Then be SURE to name
the file ending with .BAT for batch file, like CleanupShutdown.bat. Then it
will run those commands any time you double-click the file you saved.

To edit the file later, just right-click on it and choose Edit, which should
open it in notepad.

Hope that's cool for ya,

- skeene
 
Thank you so much. Guess they didn't take away
all the good things
with WinXP

"Shawn Keene"
message
Kindof. You can make yourself a shortcut on your
desktop (or anywhere you
want) that automatically runs the disk cleanup
then shuts down your computer.
You have to make the batch file yourself. Here's
how:

First, go to start > Run and type this:
cleanmgr /sageset:150

That number (150) can be anything you want up to
65500 or something. But
remember what number you chose.
That will open a dialog to let you choose what you
want it to clean
everytime you run the automatic-cleanup-command
(I'll get to that in a sec).
You may not want it to automatically empty the
recycle bin at every shutdown,
because it might erase something you'd want to
recover when you turn the
computer back on. Just a thought.

Anyway after you set those options, OK that
dialog.

Then, open up good old trusty Notepad. Type this
on the first line:
cleanmgr /sagerun:150

That will run the cleanup using the settings you
stored to the 150 number
(or whatever number you used above). On the next
line, put:

shutdown.exe -s -t 0

The t 0 (zero) part is how many seconds to show
the "system is about to
shutdown" box. If you use 0 (zero), it will
happen immediately. If you want
it to force-quit programs that might be waiting to
shutdown, like a program
that's still asking "do you want to save?" just
add -f (for force) to the
command line, like this:

shutdown.exe -s -t 0 -f

So your notepad file should look like this:
-----------------------
cleanmgr /sagerun:150
shutdown.exe -s -t 0 -f
-----------------------

If you want to be fancy, you can add a few
commands to it to make the dialog
look neat when you run it, like:
-----------------------
ECHO OFF
TITLE Pre-shutdown clean-up in progress...
CLS
ECHO Please wait while I run disk cleanup.
ECHO The computer will turn off as soon as cleanup
is complete.
cleanmgr /sagerun:150
shutdown.exe -s -t 0 -f
-----------------------
That will turn off the messages (echo off), set
the DOS window title to
"Pre-shutdown clean-up in progress..." (instead of
c:\windows\cmd.exe), then
it will show those two lines of text in thd DOS
window while it's working.


The last part, save the file. Go to File > Save
As, but before you
save--change the file type drop-down to "all
files". Then be SURE to name
the file ending with .BAT for batch file, like
CleanupShutdown.bat. Then it
will run those commands any time you double-click
the file you saved.

To edit the file later, just right-click on it and
choose Edit, which should
open it in notepad.

Hope that's cool for ya,

- skeene
 
Back
Top