Many Thanks - that is working.
I assume the double quotes at the start of ""W:\SpeedTest\" is a harmless typo,
It seems to have no effect on operation if I retain or delete the excess ".
There is one strange side-effect that puzzles me.
My originally code can restrict its selection of files with, for example, the mask *.bin
e.g.
Code: Select all
FOR %%f IN ("W:\SpeedTest\*.bin") DO CALL :My-C "%%f"
the code :My-C is invoked whilst its current directory is C:\ or whatever the script happened to be launched with.
Your code has the side effect that My-C is executed with W:\SpeedTest\ as its current directory.
This adaptation of your code works as well as your original, and has the same side effect
Code: Select all
pushd ""W:\SpeedTest\"
for /f "delims=" %%f in (' dir "W:\SpeedTest\*.bin" /b /os /a-d ') do CALL :My-C "%%f"
popd
By removing the pushd and popd I remove the side effect
Code: Select all
for /f "delims=" %%f in (' dir "W:\SpeedTest\*.bin" /b /os /a-d ') do CALL :My-C "%%f"
unfortunately this somehow causes :My-C to misbehave.
Is there a simple fix that avoids the need for pushd and popd ?
If not I can live with it.
Again, many thanks.
Regards
Alan