Thursday, July 30, 2015

windows - batch not capturing hidden files


The following lines allowed me to list all the files, folders, and sub-folders in file TXT, but the problem is that the hidden files are not included in file TXT. So, what do I have to do?


@echo off
set /a VAR=%random%
mkdir C:\Users\Blm\Desktop\folder\
for /r E:\ %%i in (*) do (echo %%i >> C:\Users\Blm\Desktop\folder\%VAR%.txt)
pause

Answer



Try replacing this line:


for /r  E:\ %%i in (*) do (echo %%i >> C:\Users\Blm\Desktop\folder\%VAR%.txt)

With this one:


dir /s/o/b /a E:\ > C:\Users\Blm\Desktop\folder\%VAR%.txt

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...