Trying to print out the 8dot3 name of a file, it does works when I paste the line in the Command Prompt but not when I run it from a batch file.
Result when pasted :
D:\tmp>cmd /e:on /c for %A in (8088_othello.com) do @echo %~nxsA
8088_O~1.COM
Result from batch file :
D:\tmp>lfn.bat
D:\tmp>cmd /e:on /c for ~nxsA
~nxsA was unexpected at this time.
What else is needed to make it work inside a batch file ?
you need to escape % is batch files
just type cmd /e:on /c for %%A in (8088_othello.com) do @echo %%~nxsA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With