Delete All (skip any conflicts). ...">

Batch file to start, run,% TEMP% and delete all

looking for a way to do the following:

Start> Run> "% TEMP%> Delete All (skip any conflicts).

I still have

@echo off start %TEMP% DEL *.* 

I suppose I could use the CD to access the folder, I wonder if there are any instances where it cannot delete the dialog box, I want to skip them.

Thanks for the help! Liam

+8
source share
9 answers

del will not cause any dialogs or messages. You have a few problems:

  • start will simply open Explorer, which will be useless. You need cd to change the working directory of your batch file ( /D , so it also works when launched from another drive):

     cd /D %temp% 
  • You can also delete directories:

     for /d %%D in (*) do rd /s /q "%%D" 
  • You need to skip the question for del and delete the read-only files:

     del /f /q * 

so you come:

 @echo off cd /D %temp% for /d %%D in (*) do rd /s /q "%%D" del /f /q * 
+20
source

If you want to delete all files in the %TEMP% folder, you can simply do this:

 del %TEMP%\*.* /f /s /q 

This will delete everything, any file with any extension ( *.* ) And do the same for all subfolders ( /s ) without asking for anything ( /q ), it will just do it, including read-only files ( /f ).

Hope this helps.

+2
source

The following command commands are used to delete all of your temp, recent and prefetch files on your system.

Save the following code as โ€œClear.batโ€ on the local system

 *********START CODE************ @ECHO OFF del /s /f /q %userprofile%\Recent\*.* del /s /f /q C:\Windows\Prefetch\*.* del /s /f /q C:\Windows\Temp\*.* del /s /f /q %USERPROFILE%\appdata\local\temp\*.* /Below command to Show the folder after deleted files Explorer %userprofile%\Recent Explorer C:\Windows\Prefetch Explorer C:\Windows\Temp Explorer %USERPROFILE%\appdata\local\temp *********END CODE************ 
+2
source

cd C: \ Users \% username% \ AppData \ Local rmdir / S / Q Temp

del C: \ Windows \ Prefetch *. * / Q

del C: \ Windows \ Temp *. * / Q

del C: \ Users \% username% \ AppData \ Roaming \ Microsoft \ Windows \ Recent Items *. * / Q pause

+1
source
 @echo off RD %TEMP%\. /S /Q ::pause explorer %temp% 

This batch can be launched from anywhere. RD means "Delete Directory", but it can delete both folders and files that can be deleted.

+1
source
 @echo off del /s /f /q %windir%\temp\*.* rd /s /q %windir%\temp md %windir%\temp del /s /f /q %windir%\Prefetch\*.* rd /s /q %windir%\Prefetch md %windir%\Prefetch del /s /f /q %windir%\system32\dllcache\*.* rd /s /q %windir%\system32\dllcache md %windir%\system32\dllcache del /s /f /q "%SysteDrive%\Temp"\*.* rd /s /q "%SysteDrive%\Temp" md "%SysteDrive%\Temp" del /s /f /q %temp%\*.* rd /s /q %temp% md %temp% del /s /f /q "%USERPROFILE%\Local Settings\History"\*.* rd /s /q "%USERPROFILE%\Local Settings\History" md "%USERPROFILE%\Local Settings\History" del /s /f /q "%USERPROFILE%\Local Settings\Temporary Internet Files"\*.* rd /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files" md "%USERPROFILE%\Local Settings\Temporary Internet Files" del /s /f /q "%USERPROFILE%\Local Settings\Temp"\*.* rd /s /q "%USERPROFILE%\Local Settings\Temp" md "%USERPROFILE%\Local Settings\Temp" del /s /f /q "%USERPROFILE%\Recent"\*.* rd /s /q "%USERPROFILE%\Recent" md "%USERPROFILE%\Recent" del /s /f /q "%USERPROFILE%\Cookies"\*.* rd /s /q "%USERPROFILE%\Cookies" md "%USERPROFILE%\Cookies" 
+1
source

easy to use; del / f / q C: \ Users * username * \ AppData \ Local \ temp and it will work jou'll delete the whole map then, but windows will do it again

0
source

I used the bat file to delete the temporary file, but as shown in the drop-down menu, I entered Y and hit enter, then all the desktop data was deleted.

ask you to kindly offer to restore the file that I lost.

0
source
 @echo off del /s /f /qc:\windows\temp\*.* rd /s /qc:\windows\temp md c:\windows\temp del /s /f /q C:\WINDOWS\Prefetch del /s /f /q %temp%\*.* rd /s /q %temp% md %temp% deltree /yc:\windows\tempor~1 deltree /yc:\windows\temp deltree /yc:\windows\tmp deltree /yc:\windows\ff*.tmp deltree /yc:\windows\history deltree /yc:\windows\cookies deltree /yc:\windows\recent deltree /yc:\windows\spool\printers del c:\WIN386.SWP cls 
-1
source

Source: https://habr.com/ru/post/916434/


All Articles