I am trying to print list of all the files and folders present in different partitions of hard disk using :
for %d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (ifexist %d: (dir %d:/s >> %Systeminfo_TXT%))
but this doesn't print any output ?
Where am i going wrong !!
Did you define the variable %Systeminfo_TXT%?
The "ifexist" command is not valid in batch files. Instead, you can use the "if" command with the "exist" operator to check if a drive exists.
for %%d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do ( if exist %%d: ( dir %%d:\ /s >> %Systeminfo_TXT% ) )