I started this test from R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\
and ran these three commands :-
DIR /AD /S /B > MYLIST-1.TXT
DIR /A-D /S /B > MYLIST-2.TXT
DIR /A /S /B > MYLIST-3.TXT
Results :-
MYLIST-1.TXT
Size 4 KB
46 Lines
113 characters maximum length
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\Images\Easeus_ToGo\Disk and Partition backup 8-30-2011 8-12 AM
Questionable characters are double dot extensions for the first folder name, and ~ in this name
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\Master Images\C~50GB\Reflect-html
MYLIST-2.TXT
Size 65 KB
681 Lines
166 characters maximum length
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\Master Images\Rescue_ISOs\SYSTEM{2d3788cd-8c19-11e0-bccd-001e8c888f33}.TMContainer00000000000000000001.regtrans-ms
MYLIST-3.TXT
Size 68 KB
727 Lines
166 characters maximum length
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\Master Images\Rescue_ISOs\SYSTEM{2d3788cd-8c19-11e0-bccd-001e8c888f33}.TMContainer00000000000000000001.regtrans-ms
When I run the original script the CMD.EXE window shows the same as before - but it is much faster when not running from root of R:\
Code: Select all
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS>#
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS>FOR /R "" %a IN (*-00-*.mrimg) DO ECHO %a
The full path of is too long.
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS>PAUSE
Press any key to continue . . .
There are two groups of archives so I tested which gave the problem by doing each separately
Code: Select all
FOR /R "Images" %%a IN (*-00-*.mrimg) DO ECHO %%a
FOR /R "Master Images" %%a IN (*-00-*.mrimg) DO ECHO %%a
Head banging moment, they both worked
I tried
Code: Select all
FOR /R "R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS" %%a IN (*-00-*.mrimg) DO ECHO %%a
That also worked without problem
I am getting somewhere - don't know where yet
New code
Code: Select all
FOR /R "R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS" %%a IN (*-00-*.mrimg) DO ECHO %%a
echo full name __ -"R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS"-
echo current name -"%~1"-
Results as before and followed by :-
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS>echo current name -""-
current name -""-
R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS>PAUSE
Press any key to continue . . .
To my script I appended
Code: Select all
echo ------------ -"%~dp0"-0
echo ------------ -"%~dp1"-1
echo ----------- -"%~dp2"-2
Result :-
Code: Select all
full name __ -"R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS"-
current name -""-
------------ -"R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS\"-0
------------ -""-1
----------- -""-2
Conclusion
I now get the same successful results from either
Code: Select all
FOR /R "R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS" %%a IN (*-00-*.mrimg) DO ECHO %%a
FOR /R "%~dp0" %%a IN (*-00-*.mrimg) DO ECHO %%a
N.B.
"%~dp0" has one more character, a trailing '\', compared with
"R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS"
Supplementary
I get identical results from all of :-
Code: Select all
FOR /R "R:\LS-3.3.1\RecoveredData\_E_GPT_E__465.82 GB_NTFS" %%a IN (*-00-*.mrimg) DO ECHO %%a
FOR /R "%~dp0" %%a IN (*-00-*.mrimg) DO ECHO %%a
FOR /R %%a IN (*-00-*.mrimg) DO ECHO %%a
OBSERVATIONS
The original warning is a CMD.EXE stupidity.
I get the same warning from either of
Code: Select all
FOR /R "" %%a IN (*-00-*.mrimg) DO ECHO %%a
FOR /R "%~1" %%a IN (*-00-*.mrimg) DO ECHO %%a
and yet they is no output and no warning at all for
Code: Select all
FOR /R "Folder name that does not exist" %%a IN (*-00-*.mrimg) DO ECHO %%a
FINALLY
Thanks for getting me to consider "FOR /R ..."
That is an option I never used before or even remembered seeing.
Regards
Alan