Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 352
emesx Avatar asked Jan 17 '12 17:01

emesx


2 Answers

del /S /F /AH *.suo

the /AH switch (as specified in del /? turns on deletion of hidden files.

like image 158
Benoit Avatar answered Oct 12 '22 16:10

Benoit


del /ah

deletes hidden files, but

del /a

deletes hidden and system and read-only files too.

like image 33
ec2011 Avatar answered Oct 12 '22 16:10

ec2011