寻找执行下列任务的方法:
开始 & gt; 运行 & gt; "% TEMP% & gt; 删除一切( 避免任何冲突) 。
至于我
@echo off
start %TEMP%
DEL *.*
我想,我可以用CD 进入文件夹, 我想知道的是,如果有任何情况 它不能删除一个对话框, 我想跳过这些。
Thanks for the help! Liam
寻找执行下列任务的方法:
开始 & gt; 运行 & gt; "% TEMP% & gt; 删除一切( 避免任何冲突) 。
至于我
@echo off
start %TEMP%
DEL *.*
我想,我可以用CD 进入文件夹, 我想知道的是,如果有任何情况 它不能删除一个对话框, 我想跳过这些。
Thanks for the help! Liam
del
将不会触发任何对话框或信件框。 您有一些问题, 不过 :
start
只会打开无用的探索器。 您需要 > cd
来更改您的批量文件的工作目录( / D
在那里, 所以从不同的驱动器运行时也会有效 ):
cd /D %temp%
您也可以删除目录 :
for /d %%D in (*) do rd /s /q "%%D"
您需要跳过 del
的问题, 并删除只读文件 :
del /f /q *
因此,您可以到达:
@echo off
cd /D %temp%
for /d %%D in (*) do rd /s /q "%%D"
del /f /q *
以下批次命令用于删除您系统中的所有临时、最近和预发文件 。
在您的本地系统中将以下代码另存为“ Clear.bat ”
*********START CODE************
@ECHO OFF
del /s /f /q %userprofile%Recent*.*
del /s /f /q C:WindowsPrefetch*.*
del /s /f /q C:WindowsTemp*.*
del /s /f /q %USERPROFILE%appdatalocal emp*.*
/Below command to Show the folder after deleted files
Explorer %userprofile%Recent
Explorer C:WindowsPrefetch
Explorer C:WindowsTemp
Explorer %USERPROFILE%appdatalocal emp
*********END CODE************
如果您想要删除
del %TEMP%*.* /f /s /q
这将删除所有内容, 任何带有任何扩展名的文件 (/s
) 都做同样的操作, 而不催促您做任何事情 (/q
), 它只会做, 包括只读文件 (/f
)。
希望这能帮上忙
@echo off
RD %TEMP%. /S /Q
::pause
explorer %temp%
This batch can run from anywhere. RD stands for Remove Directory but this can remove both folders and files which available to delete.
cd C:Users\%username%AppDataLocal rmdir /S /Q Temp
* Q/Q。
del C: 窗口测试*. */Q
del C:Users\%username%AppDataRoamingMicrosoftWindowsRecent Items*.* /Q pause
@echo off
del /s /f /q %windir% emp*.*
rd /s /q %windir% emp
md %windir% emp
del /s /f /q %windir%Prefetch*.*
rd /s /q %windir%Prefetch
md %windir%Prefetch
del /s /f /q %windir%system32dllcache*.*
rd /s /q %windir%system32dllcache
md %windir%system32dllcache
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 SettingsHistory"*.*
rd /s /q "%USERPROFILE%Local SettingsHistory"
md "%USERPROFILE%Local SettingsHistory"
del /s /f /q "%USERPROFILE%Local SettingsTemporary Internet Files"*.*
rd /s /q "%USERPROFILE%Local SettingsTemporary Internet Files"
md "%USERPROFILE%Local SettingsTemporary Internet Files"
del /s /f /q "%USERPROFILE%Local SettingsTemp"*.*
rd /s /q "%USERPROFILE%Local SettingsTemp"
md "%USERPROFILE%Local SettingsTemp"
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"
@echo off
del /s /f /q c:windows emp*.*
rd /s /q c:windows emp
md c:windows emp
del /s /f /q C:WINDOWSPrefetch
del /s /f /q %temp%*.*
rd /s /q %temp%
md %temp%
deltree /y c:windows empor~1
deltree /y c:windows emp
deltree /y c:windows mp
deltree /y c:windowsff*.tmp
deltree /y c:windowshistory
deltree /y c:windowscookies
deltree /y c:windows
ecent
deltree /y c:windowsspoolprinters
del c:WIN386.SWP
cls
仅使用
del /f /q C:Users\%username%AppDataLocal emp
并且它会有效。
注: 它会删除整个文件夹, 但是, Windows 会按需要重塑它 。
I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...
I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit. But on 64 bit server the environment variable %processor_architecture% is returning x86 instead of AMD64. ...
IF %processor_architecture% == AMD64 (SET querypath=hklmsoftwarex) ELSE (SET dsetquerypath=hklmsoftwarey) FOR /F "tokens=* delims=" %%G IN ( REG QUERY "%querypath%" 2^>NUL ) DO ECHO %%G Let ...
I have a batch script that takes arguments from the command line. One of the arguments has a * in it. In spite of putting the argument in quotes, the * gets expanded before the argument gets used in ...
Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]
Binary files have a version embedded in them - easy to display in Windows Explorer. How can I retrieve that file version, from a batch file?
How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....
I don t know how to describe exactly what I m trying to do but here s an example batch file that demonstrates what I can t figure out.: I ve got a batch file. Inside that batch file I m trying to ...