
[已解決]批處理刪除文件夾遇到沒插存儲卡的可移動磁盤如何不彈窗口rd /s /q f:RECYCLER >nul 2>nulxp系統下運行這個命令,1、如果f盤符不存在,不會彈出信息菜單2、如果f盤符光驅,也不會彈出信息菜單3、如果f盤符是筆記本的讀卡器,里面也沒有插存儲卡的話,會彈出一個沒有找到軟驅的類似菜單。每次都只有點“繼續”按鈕,才能運行。這種情況,如何讓這個命令后臺靜默運行?而不彈出這種菜單?基本確定是xp系統的問題。使用精簡版本的電腦公司xp ghost系統,出現的怪問題。更新:運行下面這個bat批處理文件(目的是刪除 我的電腦 里面 所有盤下面的指定目錄)。好像已經不彈出窗口了。
nclick="copycode($('code0'));">復制代碼
- for /f skip=1 delims= %%a in ('Wmic LogicalDisk Where DriveType='2' and SupportsDiskQuotas='FALSE' Get DeviceID') do call :s1 %%a
- for /f skip=1 delims= %%a in ('Wmic LogicalDisk Where DriveType='3' Get DeviceID') do call :s1 %%a
- :s1
- if %~1== goto:eof
- if exist %1RECYCLER del /f /s /q /ah %1RECYCLER*.* >nul 2>nul
- if exist %1RECYCLER del /f /s /q /a %1RECYCLER*.* >nul 2>nul
- if exist %1RECYCLER rd /s /q %1RECYCLER >nul 2>nul
- if exist %1Recycled del /f /s /q /ah %1Recycled*.* >nul 2>nul
- if exist %1Recycled del /f /s /q /a %1Recycled*.* >nul 2>nul
- if exist %1Recycled rd /s /q %1Recycled >nul 2>nul
- if exist %1kvideo_cache del /f /s /q /ah %1kvideo_cache*.* >nul 2>nul
- if exist %1kvideo_cache del /f /s /q /a %1kvideo_cache*.* >nul 2>nul
- if exist %1kvideo_cache rd /s /q %1kvideo_cache >nul 2>nul
- if exist %1$RECYCLE.BIN del /f /s /q /ah %1$RECYCLE.BIN*.* >nul 2>nul
- if exist %1$RECYCLE.BIN del /f /s /q /a %1$RECYCLE.BIN*.* >nul 2>nul
- if exist %1$RECYCLE.BIN rd /s /q %1$RECYCLE.BIN >nul 2>nul
- goto:eof

