Saturday, 15 March 2014

Hiding Unknown Files in Batch Files -



Hiding Unknown Files in Batch Files -

hey guys need know how hide file of dont know name of.

for instance have 6 folders named 1-6 think named a-f. , directory c:\users\all users\bond.

how go doing this?

i dont need hide directory of files located need able come in directory , hide files within.

here's thing can think of:

@echo off cd c:\users\all users\bond attrib +h +s %filename% * echo. echo files hidden. pause exit

you iterate on folders.

the for command can takes list of folder names or wildcards.

@echo off cd /d c:\users\all users\bond /d %%d in (folder names go here) ( pushd %%d attrib +h *.* popd ) exit /b

if need process all folders in current directory, set * there:

... /d %%d in (*) ( ...

you not alter parent directory specify in for loop instead (note quotes around mask):

@echo off /d %%d in ("c:\users\all users\bond\*") ( ...

similarly, omit jumping in , out of each subdirectory , instead specify path in attrib command.

so, above script rewritten this:

@echo off /d %%d in ("c:\users\all users\bond\*") attrib +h "%%d\*" exit /b

file batch-file folders hidden-files

No comments:

Post a Comment