
[已解決]批處理能不能檢測是否有文件夾打開謝謝最后由 yyz219 于 -1-22 11:13
nclick="copycode($('code0'));">復制代碼
- 解決了:
- ::【大概需要3、4秒】
- @echo off
- powershell -c (New-Object -ComObject 'Shell.Application').Windows() | foreach{ $_.LocationURL }>123.txt
- ::【檢測 “關鍵字”:file】
- findstr file 123.txt >nul 2>&1
- if errorlevel 1 goto :C %【無就跳到 :C】%
- if errorlevel 0 goto :D %【有就跳到 :D】%
- :C
- del 123.txt
- echo無
- pause >nul
- exit
- :D
- del 123.txt
- echo有
- pause >nul
- exit

