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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User directory wild card in a simple batch file 1

Status
Not open for further replies.

jkittlejr

IS-IT--Management
Dec 1, 2003
6
US
I need to create simple batch file that cleans out the user’s local temp directory of my W2K users at startup. What I need to know is the wild card, or correct syntax, to specify the individual user directory of each user.

I want the batch file to change to the user directory of the person logging on to the W2K machine and then delete all temp files. As an example I would place this file in the start up group of each user:

cd\ c:\documents and settings\*user*\local settings\temp
del *.tmp

What I do not know is how to generically specify the user directory.
 
jkillejr,

See my notes and those of others here: thread779-992214

I would have approached the issue differently, but there is nothing technicly wrong witht the suggestions made in the link thread above.

Natively, you have the SAGESET and SAGERUN features of the disk cleanup tool. This is perfetly batchable and scriptable. I would have used cleanmgr rather than a batch or script file as described above, using a SAGEGRUN from a pre-defined SAGESET:
Either approach works.
 
Thanks for getting me going in the right direction dcastner. What I need was this:

cd %homedrive%%homepath%\local settings\temp

Worked like a charm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top