zhshqzyc
asked on
a dos batch command
Can you explain the code?
Thank you.
for /f %%c in ('"dir /b:d"') do %GZIP% %%c\*.txt
Thank you.
ASKER
Sorry, typo.
for /f %%c in ('"dir /b /a:d"') do %GZIP% %%c\*.txt
/b is bare
/a:d is attributes only show directories
/a:d is attributes only show directories
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Men has the answer :-)
Open in new window
do archive every files that has the extension .txt for every given file listed from the command dir /b according to the variable %%c.
gzip is a program / operation to archive file. the %GZIP% is a parameter / routine / process defined elsewhere.
I don't know what's parameter /b:d in the dir command, as far as I know there is no such parameter. /b will output bare formatting of the files in the respective directory, but :d (colon d) is unknown.
%%c is a self defined parameter, it can be anything.