|
Answer» i am trying to write a batch to delete the temp folder contents from path C:\Documents and Settings\alan\Local Settings\Temp
and having no luck i can delete files from anything before Documents and Settings but no SOON as Documents and Settings is put in as part of the file path i get the system cannot find the path specified, the path does exist as i have navigated there on the pc.
the same following script works on other drive with letter changed or anywhere on c drive but not the Documents and Settings path.
@echo off DEL C:\Documents and Settings\alan\Local
Settings\Temp\*.* pause
sorry if this is a stupid post lolThe path has SPACES and must be ENCLOSED in quotes. Your CODE Code: [Select]del C:\Documents and Settings\alan\Local Settings\Temp\*.* Should be changed to: Code: [Select]del "C:\Documents and Settings\alan\Local Settings\Temp\*.*" Or, why not use the environment variable for the temp folder with: Code: [Select]del "%Temp%\*.*"
But that will delete only the files. From the path you show, it appears that you are running XP. If that is the case RD will delete all the files and folders except the ones in use at the time. Code: [Select]rd /S /Q "%TEMP%\."
Notice that I did not use \*.* Instead I used only the . to represent the current directory. RD must have a directory name and *.* is not a valid directory name, while . is.
PS. Nothing stupid in asking!
|