简体   繁体   中英

Windows batch - delete a hidden file

I have the following script to clean my Visual Studio 2010 solution directory:

@echo off
FOR /D /R %%X IN (debug,release,bin,obj,ipch) DO RD /S /Q "%%X"
del /S /F *.suo
del /S /F *.user 
del /S /F *.ncb
del /S /F *.sbr
del /S /F *.log
echo Solution clean.

It works like a charm exept for the suo files - they are hidden and this script doesn't delete them.

Could you help me upgrade the script to delete the suo file too?

Kindest regards, e.

del /S /F /AH *.suo

/AH开关(在del /?指定)打开隐藏文件的删除。

del /ah

deletes hidden files, but

del /a

deletes hidden and system and read-only files too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM