Hey guys.
I would like to ask you to help me with one batchfile
I want to use a batch that runs including a timer of several seconds to clean some desktop files. Of course the sleep.exe is located in the same folder as the batchfile I want to run.
Unfortunately it doesn't want to work...
The code:
@echo off
echo Clean Desktop files...
sleep 20
del /f /s /q %userprofile%\Desktop\*.nal
del /f /s /q %userprofile%\Desktop\*.txt
echo. & pause
The error message is always: The system could not find the specified path - for both paths.
But with this (another) batch, it works all fine:
@echo off
echo Clean system temp files......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo ²M°£¨t²Î©U§£§¹¦¨¡I
echo. & pause
I'm using WinXP professional, Service Pack 3.
Thanks in advance
Locutus
Batch for cleaning folder
Moderator: DosItHelp
Re: Batch for cleaning folder
Double quotes protect batch paths and filenames from spaces and other poison characters, like &
Put them in all your "c:\paths\filenames"
Put them in all your "c:\paths\filenames"
Code: Select all
del /f /s /q "%userprofile%\Desktop\*.nal"
del /f /s /q "%userprofile%\Desktop\*.txt"
Re: Batch for cleaning folder
Worked fine, thanks a lot!