home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2037
Discussions: 188,394, Posts: 2,243,575, Members: 232,624
Old February 16th, 2004, 09:00 PM   Digg it!   #1 (permalink)
Member
 
jgargac's Avatar
 
Join Date: Oct 2001
Location: St. Louis, MO
Posts: 463
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 February 16th, 2004, 09:09 PM     #2 (permalink)
Ultimate Member
 
golfcart's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 1,767
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 February 16th, 2004, 09:15 PM     #3 (permalink)
Ultimate Member
 
rpertusio's Avatar
 
Join Date: Nov 2002
Location: Hershey, PA
Posts: 1,349
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 February 16th, 2004, 09:18 PM     #4 (permalink)
Ultimate Member
 
golfcart's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 1,767
Cool
golfcart is offline   Reply With Quote
Old February 16th, 2004, 09:34 PM     #5 (permalink)
Member
 
jgargac's Avatar
 
Join Date: Oct 2001
Location: St. Louis, MO
Posts: 463
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

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

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

Most Active Discussions
Is It Just Me? (2904)
Unarmed man on his stomach shot by .. (5)
New Build ( Finally ) (6)
Building a gaming computer advice (5)
Looks like Burris will get his Sena.. (12)
CPU wont boot (7)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
building a gaming computer, inp.. (0)
Iming and surfing slowed down (3)
Laptop proccesor to desktop mob.. (0)
Please help! multiple problems! (3)
Left 4 Dead Small Freezes (1)
Install Problem for Windows Def.. (1)
RCA 52Inch HDTV wont turn on (2)
nVidia GTX 295 now available (1)
Error ~ BAD BLOCK (19)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 02:01 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28