Jump to content

Recommended Posts

Posted

I have several machines that have had people playing around with the ATTRIB

command. Now, I have some files that are no longer hidden like they should

be. I have a batch file that seems like it should work but in fact does not.

Any guidance would be great! Below is an example. I just want to search

recursively through the current folder and its child directories and run a

command if the file is found....

 

This is one line of code....

FOR /F %%I IN ("DESKTOP.INI") DO IF EXIST %%~nI ATTRIB +S +H DESKTOP.INI /S

  • Replies 2
  • Created
  • Last Reply

Popular Days

Posted

Re: Batch file help

 

You’ll get better answers if you post to:

 

alt.msdos.batch.nt.

 

-------

 

[When responding to posts, please include the post(s) you are replying to so

that others may learn and benefit from the issue]

 

 

[How to ask a question]

http://support.microsoft.com/kb/555375

 

"Tome" <pinevalleytome@yahoo.com> wrote in message

news:F3AC50B4-1AEF-44E9-A07F-D90D8E26ECF4@microsoft.com...

>I have several machines that have had people playing around with the ATTRIB

> command. Now, I have some files that are no longer hidden like they

> should

> be. I have a batch file that seems like it should work but in fact does

> not.

> Any guidance would be great! Below is an example. I just want to search

> recursively through the current folder and its child directories and run a

> command if the file is found....

>

> This is one line of code....

> FOR /F %%I IN ("DESKTOP.INI") DO IF EXIST %%~nI ATTRIB +S +H DESKTOP.INI

> /S

Guest Pegasus \(MVP\)
Posted

Re: Batch file help

 

 

"Tome" <pinevalleytome@yahoo.com> wrote in message

news:F3AC50B4-1AEF-44E9-A07F-D90D8E26ECF4@microsoft.com...

>I have several machines that have had people playing around with the ATTRIB

> command. Now, I have some files that are no longer hidden like they

> should

> be. I have a batch file that seems like it should work but in fact does

> not.

> Any guidance would be great! Below is an example. I just want to search

> recursively through the current folder and its child directories and run a

> command if the file is found....

>

> This is one line of code....

> FOR /F %%I IN ("DESKTOP.INI") DO IF EXIST %%~nI ATTRIB +S +H DESKTOP.INI

> /S

 

This seems overly complicated way of doing a simple job.

I recommend this line:

attrib desktop.ini +s +h /s


×
×
  • Create New...