-
May 2nd, 2004, 09:10 PM
#1
Junior Member
Trouble with my batch file.
Hi, I am having some trouble with my batch file:
=====
@echo
cd\
del C:\Documents and Settings\'\Cookies\*.*
del C:\Documents and Settings\'\temp\*.*
del C:\Documents and Settings\'\recent\*.*
del C:\Documents and Settings\'\Local Settings\History\*.*
del C:\Documents and Settings\'\Local Settings\Temp\*.*
del C:\Documents and Settings\'\Local Settings\Temporary Internet Files\*.*
pause
=====
Each time I run it, it tells me "the system cannot find the path specified". I believe the path is correct because I have my folder options set to show the full path in the top bar and that is how it looks, verbatim. What am I doing wrong, I know it has to be something simple I just can't seem to be able to figure it out?
Thanks in advance.
~.bat-man
-
May 2nd, 2004, 09:39 PM
#2
=====
@echo
cd\
del C:\Documents and Settings\%Username%\Cookies\*.*
del C:\Documents and Settings\%Username%\temp\*.*
del C:\Documents and Settings\%Username%\recent\*.*
del C:\Documents and Settings\%Username%\Local Settings\History\*.*
del C:\Documents and Settings\%Username%\Local Settings\Temp\*.*
del C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\*.*
pause
=====
That should help.
-
May 2nd, 2004, 09:46 PM
#3
Junior Member
Hey SDK, is it not working because the username on both my accounts is ' and ''? Maybe if I changed them to a standard character it would work? What do you think? I'm not sure why I use those types of characters as my usernames, I just always have.
PS: thanks a ton for helping me out!
~.bat-man
Ok, I just set up another account named "wayne" and the batch file wouldn't work from there either. Same error message. Not sure what the heck is going wrong, the syntax looks correct now? These paths do exist on my computer...
-
May 2nd, 2004, 11:02 PM
#4
Junior Member
Ok SDK, I finally got that puppy to work. For some reason putting quotes around the files I was wanting to delete made the thing work.
Like this:
========
@echo
cd\
del "C:\Documents and Settings\%Username%\Cookies\*.*" /F /Q
del "C:\Documents and Settings\%Username%\temp\*.*" /F /Q
del "C:\Documents and Settings\%Username%\recent\*.*" /F /Q
del "C:\Documents and Settings\%Username%\Local Settings\History\*.*" /F /Q
del "C:\Documents and Settings\%Username%\Local Settings\Temp\*.*" /F /Q
del "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\*.*" /F /Q
pause
========
Voila!
I'm just glad the dang thing is working! Thanks again SDK, the %username% thing works well, because it determines who you are and then deletes the files accordingly. Pretty neat! And why the hell doesn't del /? tell you that you are supposed to use quote tags for things like this to work!?
~.bat-man
This one works well too:
=======
@echo
cd\
rmdir "C:\Documents and Settings\%Username%\Cookies\" /Q /S
rmdir "C:\Documents and Settings\%Username%\temp\" /Q /S
rmdir "C:\Documents and Settings\%Username%\recent\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\History\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temp\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\" /Q /S
pause
=======
-
May 3rd, 2004, 02:37 AM
#5
Np Welcome to AO.
-
May 3rd, 2004, 05:41 AM
#6
Member
The reason the batch file didn't work without the qoutes around the path is that the spaces in Documents and Settings. You del or rmdir without qoutes as long as your path doesnt have any spaces in it.
-
May 3rd, 2004, 02:54 PM
#7
Junior Member
Originally posted here by SDK
Np Welcome to AO.
Thanks!
Originally posted here by wyred
The reason the batch file didn't work without the qoutes around the path is that the spaces in Documents and Settings. You del or rmdir without qoutes as long as your path doesnt have any spaces in it.
Thank you for explaining that ,wyred. I was wondering about that.
This is what I finally came up with for myself:
=======
@echo
cd\
del "C:\Documents and Settings\%Username%\Cookies\*.*" /F /Q /S
del "C:\Documents and Settings\%Username%\temp\*.*" /F /Q /S
del "C:\Documents and Settings\%Username%\recent\*.*" /F /Q /S
del "C:\Documents and Settings\%Username%\Local Settings\History\*.*" /F /Q /S /A H R S
del "C:\Documents and Settings\%Username%\Local Settings\Temp\*.*" /F /Q /S
del "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\*.*" /F /Q /S /A H R S
del "C:\Documents and Settings\%Username%\My Recent Documents\*.*" /F /Q /S
del "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\*.*" /F /Q /S
del C:\WINDOWS\Temp\*.* /F /Q /S /A H R S
del index.dat /s /f /q
del *.tmp *.chk *.$$$ *.~ *.~~~ *.temp *.trc *.bak *.mov *.mpeg *.mp3 *.wav *.tiff *.mpg *.ram *.scr /s /q /f
rmdir "C:\Documents and Settings\%Username%\Cookies\" /Q /S
rmdir "C:\Documents and Settings\%Username%\temp\" /Q /S
rmdir "C:\Documents and Settings\%Username%\recent\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\History\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temp\" /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\" /Q /S
pause
=======
Nice and sloppy, just the way I like it!
~.bat-man
-
May 7th, 2004, 05:38 PM
#8
Junior Member
Just wanted to add that this works much better:
*******
@echo
cd\
del "C:\Documents and Settings\%Username%\Cookies\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\Cookies\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Cookies\"
del "C:\Documents and Settings\%Username%\temp\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\temp\" /Q /S
mkdir "C:\Documents and Settings\%Username%\temp\"
del "C:\Documents and Settings\%Username%\recent\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\recent\" /Q /S
mkdir "C:\Documents and Settings\%Username%\recent\"
del "C:\Documents and Settings\%Username%\Local Settings\History\*.*" /F /Q /S /A H R S
rmdir "C:\Documents and Settings\%Username%\Local Settings\History\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\History\"
del "C:\Documents and Settings\%Username%\Local Settings\Temp\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temp\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\Temp\"
del "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\*.*" /F /Q /S /A H R S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\"
del "C:\Documents and Settings\%Username%\My Recent Documents\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\My Recent Documents\" /Q /S
mkdir "C:\Documents and Settings\%Username%\My Recent Documents\"
del "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\*.*" /F /Q /S
rmdir "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\" /Q /S
mkdir "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\"
del C:\WINDOWS\Temp\*.* /F /Q /S /A H R S
rmdir C:\WINDOWS\Temp\ /Q /S
mkdir C:\WINDOWS\Temp\
del "C:\WINDOWS\Temporary Internet Files\*.*" /F /Q /S /A H R S
rmdir "C:\WINDOWS\Temporary Internet Files\" /Q /S
mkdir "C:\WINDOWS\Temporary Internet Files\"
del C:\WINDOWS\Cookies\*.* /F /Q /S /A H R S
rmdir C:\WINDOWS\Cookies\ /Q /S
mkdir C:\WINDOWS\Cookies\
del C:\TEMP\*.* /F /Q /S
rmdir C:\Temp\ /Q /S
mkdir C:\Temp\
del index.dat /S /F /Q
del *.tmp *.chk *.$$$ *.~ *.~~~ *.temp *.trc *.bak *.mov *.mpeg *.wav *.tiff *.mpg *.ram *.scr *.old *.avi /S /F /Q
pause
*******
Remaking the directories has worked out much better for me and has resulted in more funtionality. The other one had some slightly undesirable effects... (as it turns out, some of those directories don't remake themselves like the others do) if they exist at all.... lol
~.bat-man
-
May 7th, 2004, 05:38 PM
#9
Junior Member
Just wanted to add that this works much better:
*******
@echo
cd\
del "C:\Documents and Settings\%Username%\Cookies\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\Cookies\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Cookies\"
del "C:\Documents and Settings\%Username%\temp\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\temp\" /Q /S
mkdir "C:\Documents and Settings\%Username%\temp\"
del "C:\Documents and Settings\%Username%\recent\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\recent\" /Q /S
mkdir "C:\Documents and Settings\%Username%\recent\"
del "C:\Documents and Settings\%Username%\Local Settings\History\*.*" /F /Q /S /A H R S
rmdir "C:\Documents and Settings\%Username%\Local Settings\History\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\History\"
del "C:\Documents and Settings\%Username%\Local Settings\Temp\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temp\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\Temp\"
del "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\*.*" /F /Q /S /A H R S
rmdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\" /Q /S
mkdir "C:\Documents and Settings\%Username%\Local Settings\Temporary Internet Files\"
del "C:\Documents and Settings\%Username%\My Recent Documents\*.*" /F /Q /S
rmdir "C:\Documents and Settings\%Username%\My Recent Documents\" /Q /S
mkdir "C:\Documents and Settings\%Username%\My Recent Documents\"
del "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\*.*" /F /Q /S
rmdir "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\" /Q /S
mkdir "C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\"
del C:\WINDOWS\Temp\*.* /F /Q /S /A H R S
rmdir C:\WINDOWS\Temp\ /Q /S
mkdir C:\WINDOWS\Temp\
del "C:\WINDOWS\Temporary Internet Files\*.*" /F /Q /S /A H R S
rmdir "C:\WINDOWS\Temporary Internet Files\" /Q /S
mkdir "C:\WINDOWS\Temporary Internet Files\"
del C:\WINDOWS\Cookies\*.* /F /Q /S /A H R S
rmdir C:\WINDOWS\Cookies\ /Q /S
mkdir C:\WINDOWS\Cookies\
del C:\TEMP\*.* /F /Q /S
rmdir C:\Temp\ /Q /S
mkdir C:\Temp\
del index.dat /S /F /Q
del *.tmp *.chk *.$$$ *.~ *.~~~ *.temp *.trc *.bak *.mov *.mpeg *.wav *.tiff *.mpg *.ram *.scr *.old *.avi /S /F /Q
pause
*******
Remaking the directories has worked out much better for me and has resulted in more funtionality. The other one had some slightly undesirable effects... (as it turns out, some of those directories don't remake themselves like the others do) if they exist at all.... lol
~.bat-man
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|