1.

Solve : batch files in XP??

Answer»

Hi everyone...I was just trying to make a batch file to delete cookies from a system. I was forgetting that in XP the cookies are in the user directory and I'm having trouble figuring out what to do with this LINE.

Code: [Select]del c:\"Documents and SETTINGS"\Smitty\Cookies\*.txt
It works fine when I use it on my machine but what should I do to allow someone to use it on another machine with a different account name? Is it even possible with DOS batch files?

I've tried a wildcard with no luck...

Code: [Select]del c:\"Documents and Settings"\*\Cookies\*.txt
Does anyone happen to have a solution for this? I appreciate any help I don't believe wildcards will identify a directory STRUCTURE...you would have to customise it to each users directory naming structure.

patio. 8-)If you want to delete all the cookie files from all the users. you can use the /S switch of del command to go into subdirectories to delete the cookie files.For the current user only:
Code: [Select]del %homedrive%%homepath%\Cookies\*.txt
For all users (from a batch file):
Code: [Select]for /f "delims=" %%a in ('dir "C:\Documents and Settings" /b') do del "C:\Documents and Settings\%%a\Cookies\*.txt"
For all users (from a command line):
Code: [Select]for /f "delims=" %a in ('dir "C:\Documents and Settings" /b') do del "C:\Documents and Settings\%a\Cookies\*.txt"^ Thanks a lot...It works like a charm hei guys, I need to brows dirs recursively stoppind each TIME I find specific files (DEPENDING on their extension) is it posible to be done in a batch file? i need to run a program for everyone of them...

Thanks.



Discussion

No Comment Found