»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 02-16-2004, 06:00 PM   #1 (permalink)
Registered User
 
jgargac's Avatar
 
Join Date: Oct 2001
Location: St. Louis, MO
Posts: 455
jgargac is on a distinguished road
script to delete temp files?

Hi all,

I'm trying to develop a batch file or script to delete a temp folder on computers. The only way that I see to do this is to use a batch file. However, the batch file says that it can't find the directory. Sample:

del %userprofile%\locals~1\temp\*.*

However, %userprofile% outputs c:\documents and settings\username and the del command has trouble with the spaces. I would ideally like to use Windows Script, but looks as if it can only delete files specified in the script. Any help would be greatly appreciated. Thanks,

Jeff

jgargac is offline   Reply With Quote
Old 02-16-2004, 06:09 PM   #2 (permalink)
Registered User
 
golfcart's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 1,680
golfcart is on a distinguished road
You could try "RD" instead of "del".

RD /S /q "%userprofile%\locals~1\temp"

I don't know if it will work or not. If it does, it will delete the entire folder. When it's needed, the folder will automatically be recreated.
golfcart is offline   Reply With Quote
Old 02-16-2004, 06:15 PM   #3 (permalink)
Registered User
 
rpertusio's Avatar
 
Join Date: Nov 2002
Location: Hershey, PA
Posts: 1,013
rpertusio is on a distinguished road
Send a message via AIM to rpertusio
yes, golfcart, I can confirm that it works. Furthermore, I changed locals~1 to Local Settings and it worked just fine.

jgargac, the "quotes" around the entire path will allow spaces.

- rp
rpertusio is offline   Reply With Quote
Old 02-16-2004, 06:18 PM   #4 (permalink)
Registered User
 
golfcart's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 1,680
golfcart is on a distinguished road
Cool
golfcart is offline   Reply With Quote
Old 02-16-2004, 06:34 PM   #5 (permalink)
Registered User
 
jgargac's Avatar
 
Join Date: Oct 2001
Location: St. Louis, MO
Posts: 455
jgargac is on a distinguished road
Thanks golfcard and rpertusio. This was driving me nuts. I appreciate the help.

Jeff
jgargac is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 06:00 PM.