This should do the job and hides folders also.
attrib +s +h "c:\folder\*.*" /D
Pergunta
I want to create a small .bat file that will hide all items in one specific folder (actually add attributes +s and +h to them), but I am not really good at scripting so I need your help.
Thanks in advance.
edit: I don't want folder to be hidden, but just all items inside it.
Solução 2
This should do the job and hides folders also.
attrib +s +h "c:\folder\*.*" /D
Outras dicas
use dir /A /D
, the result gives all directory names enclosed in [] and file name without []. Loop through all the names which are not enclosed within [] and set the attribute using attrib +s +h
for /f "delims=" %%a in ('dir /a /b "c:\somewhere\*"') do attrib +h +s "%%~fa"