引用 | 編輯
a770123
2006-07-18 18:38 |
1樓
▲ ▼ |
複製程式
CLS @ECHO OFF ECHO. attrib -s -h -r /s %Windir%\Temp\*.* del /S /Q %Windir%\Temp\*.* EXIT 看是不是符合您的需求!! x1 |
引用 | 編輯
chang-pony
2006-07-19 17:35 |
2樓
▲ ▼ |
cls 是 DOS 時代為了畫面好看,用來清除螢幕的指令,在WINDOWS是新開一個小視窗來執行批次檔,所以這個指令可以省略。
如果所要刪除的檔案很多,而不想看螢幕上顯示刪除的實況,可以將它導向: del /S /Q %Windir%\Temp\*.* > nul x1 |
引用 | 編輯
chang-pony
2006-07-19 19:48 |
4樓
▲ ▼ |
在 DOS 下鍵入 HELP,會有 DOS 指令簡介,如對單一指令有問題時,就打該指令求助,如: cls /?
因指令不少,所以請自行參考。 x0 |
引用 | 編輯
fishj07
2006-07-19 20:50 |
5樓
▲ ▼ |
下面是引用chang-pony於2006-07-19 19:48發表的 : -s -h -r /s 她沒有寫耶!! 我是有看到其他的 但是/的 沒有加以說明 x0 |
引用 | 編輯
冰漾
2006-07-19 22:20 |
6樓
▲ ▼ |
下面是引用fishj07於2006-07-19 20:50發表的 :那是 attrib 的參數... 請打 attrib /? x0 |
引用 | 編輯
ghost70
2006-07-20 10:20 |
7樓
▲ ▼ |
我又遇到問題了 我依照一樓大大說的指令做
無法刪除 C:\Documents and Settings\aaa\Local Settings\Temp 資料夾內容檔案 aaa是我的名字 Local Settings是隱藏資料夾 我用的指令是 attrib -s -h -r /s C:\Documents and Settings\aaa\Local Settings\Temp\*.* del /S /Q C:\Documents and Settings\aaa\Local Settings\Temp\*.* x0 |
引用 | 編輯
chang-pony
2006-07-20 12:54 |
8樓
▲ ▼ |
請將批次檔改成:
@ echo off c: cd \Documents and Settings\aaa\Local Settings\Temp attrib -s -h -r /s *.* del /s /q *.* PS:DOS 的指令有一個特性,中間不可以有空格,否則它會把空格後面的當成參數。 x1 |
引用 | 編輯
ghost70
2006-07-20 13:16 |
9樓
▲ ▼ |
下面是引用chang-pony於2006-07-20 12:54發表的 : 感謝大大 測試後真的可以 但是你說中間不可以有空格 我不曉得是指哪兒不可以有空格 可再說清楚點嗎 謝謝 x0 |
引用 | 編輯
chang-pony
2006-07-20 16:54 |
10樓
▲ ▼ |
del /S /Q C:\Documents and Settings\aaa\Local Settings\Temp\*.*
以上面指令為例: DOS 的解讀是: del /S /Q C:\Documents 而把此後面全當成參數( and Settings\aaa\Local Settings\Temp\*.*),所以就出現錯誤而無法執行。 但此指令也可以改成: del /S /Q "C:\Documents and Settings\aaa\Local Settings\Temp\*.*" 結果相同。 x0 |
引用 | 編輯
莫力思雷靠唄
2006-07-20 18:42 |
11樓
▲ ▼ |
有需要把 C:\Documents and Settings\aaa\Local Settings\Temp\*.* 寫的那麼複雜嗎???
為什麼不把它簡易成 %Temp%\*.* x0 |
引用 | 編輯
冰漾
2006-07-20 23:06 |
12樓
▲ ▼ |
下面是引用莫力思雷靠唄於2006-07-20 18:42發表的 :是滴... 為了避免錯誤, 請大家使用『環境變數』: http://forum.shareget.com/showthread.php?t=287801 x0 |
引用 | 編輯
mingchau
2006-07-28 18:13 |
14樓
▲ ▼ |
這是我現時用的方法,比較簡單
將以下複制,副檔為.cmd (Windows XP) 或 .bat。 @ECHO OFF rd /s /q "%userprofile%\Local Settings\Temp" & md "%userprofile%\Local Settings\Temp" > nul x0 |
引用 | 編輯
pcf88
2006-08-10 20:37 |
15樓
▲ ▼ |
以下是我個人所用.大家可以試試:
檔案名:xxx.bat ----------------------------------------------------------------------------- @echo off rd /s /q %windir%\temp & md %windir%\temp del /f /s /q %userprofile%\Local Settings\Temp\*.* rmdir /s/q %userprofile%\Local Settings\Temp\ exit ------------------------------------------------------------------------------ x0 |
引用 | 編輯
allenwl
2008-09-13 12:28 |
16樓
▲ ▼ |
@echo off
Echo 清除系統暫存垃圾中... for %%a in (%tmp%\ %temp%\ %windir%\temp\ %windir%\Prefetch\ "%userprofile%\Cookies\" "%userprofile%\Recent\" "%userprofile%\Application Data\Microsoft\Office\Recent\" "%userprofile%\Local Settings\Temp\" "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5\") do del %%a /f /s /q x0 |