1.

Solve : BAT File to delete Files in Temp folder?

Answer»

Hey guys. Im attempting to run a .bat file to delete the files/folders in the Temp FOLDER within Local Settings of a user. Here's what I have...

del C:\Documents and Settings\pcadmin\Local Settings\Temp\*.*
del c:\winnt\temp\*.*
del c:\WUTemp\*.*
pause 3


The files in the other two directories wont delete also. Any suggestions on what Im doing wrong? Im running XPOk...I got the files to delete in the Temp folder. I used...

del C:\DOCUME~1\pcadmin\LOCALS~1\Temp\*.* /Q

So, how do I get the files in the Temporary Internet Files to delete? Ive TRIED...

del C:\DOCUME~1\pcadmin\LOCALS~1\TEMPOR~1\*.* /QJust some suggestions:

Use the /f switch to force read-only files
Use the /s switch to delete sub-directories
You all ready know about the /q switch

Use the %username% variable instead of a hardcoded username

Type out full PATHNAMES and filenames; if embeded SPACES quote the path\filename string

Personally I would have used a script but that's just me.

Hope this HELPS.



Discussion

No Comment Found