February 11, 200521 yr HiI have some problems with my cleanup.cmd.I want to delete all files in the %TEMP% (%tmp%) directory... and it does not work :cmdow @ /HIDshutdown.exe -r -f -t 90 -c "Reboot..."DEL /S /Q "%windir%\Temp\" //deleting windows temp : okDEL /S /Q "%TMP%" // deleting current user's (administrator) temp : Not workingDEL /S /Q "%TEMP%" //sameexit When i try to do the same commands under xp it works :/
February 11, 200521 yr Well not sure... but the main difference between your first command and the 2 other one.... is the final \ added to the end of the command.....Did you tried it?
February 11, 200521 yr Author try: Del /S "%TEMP%" /Q and: Del /S "%TMP%" /Qi'll try but i dont see the difference between /s /q and /s file /q
February 11, 200521 yr Because.....In the commands before it, the directories have been removed, therfore, new empty ones are created in their place.You don't delete a directory, you remove them. If you want another option, you can CD to %TEMP% and %TMP% and then del *.*
February 11, 200521 yr asbsamsf, Why would you add a "make directory" command to a cleanup.cmd file?because RD /s/q command will remove all files and folders including the root folder
February 11, 200521 yr Author well i hope it doesnt change the permission settings (access right)...And deltree does not work Windows shell really su**
February 11, 200521 yr Here A VBS script that might workon error resume nextSet Shell = WScript.CreateObject("WScript.Shell")WD = Shell.ExpandEnvironmentStrings("%Windir%")T1 = Shell.ExpandEnvironmentStrings("%tmp%")T2 = Shell.ExpandEnvironmentStrings("%temp%")Set fso = CreateObject("Scripting.FileSystemObject")fso.DeleteFile( T1)fso.DeleteFile( T2 )fso.DeleteFile( WD & "\Temp")'''wasnt sure if you want to remove the files or folderfso.DeleteFolder( T1)fso.DeleteFolder( T2 )fso.DeleteFolder WD & "\Temp") Edited February 11, 200521 yr by gunsmokingman
Create an account or sign in to comment