IGRACH
IGRACH

Reputation: 3635

For Loop Not Accepting ATTRIB command

I'm having a bit of a problem. FOR loop is working with ECHO command but not with ATTRIB.

for %G IN (*) DO ECHO %G

This is returnig all the files in dir, but:

for %G IN (*) DO ATTRIB %G

is returning Parameter format not correct -.

Why is this happening.

Thanks.

Upvotes: 0

Views: 312

Answers (1)

Joey
Joey

Reputation: 354416

Your file names contain spaces, which means you have to quote the argument to attrib:

for %G in (*) do attrib "%G"

Upvotes: 2

Related Questions