문제

If I have a file named " mic.txt" on a Hard drive, What are the codes that find this file and delete it ??

If batch files can't do this, What are there any other ways ?

도움이 되었습니까?

해결책

delete_my_file.bat

@echo off
set file_to_delete=mic.txt
set dir_to_look_in=C:\

:: Starting loop
for /f "tokens=1* delims=" %%f in ('dir /s /o /b "%dir_to_look_in%" ^| findstr "%file_to_delete%"') do (
    echo INFO: Deleting: %%f
    del /q "%%f"
)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top