Read about spaces in URL and percent encoding. However, %
has special meaning in Windows CLI and cmd
batch files...
Read 8.3 file name creation on NTFS partitions. You could see 8.3
filenames using dir /X
supposing those are enabled for a particular volume. However, it will work on local drives only: under administrator command prompt, one can query NTFS
filesystem using the fsutil.exe
utility:
C:\Windows\system32>fsutil.exe behavior query Disable8dot3 c:
The volume state is: 0 (8dot3 name creation is enabled).
The registry state is: 2 (Per volume setting - the default).
Based on the above two settings, 8dot3 name creation is enabled on c:
C:\Windows\system32>fsutil.exe behavior query Disable8dot3 d:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 2 (Per volume setting - the default).
Based on the above two settings, 8dot3 name creation is disabled on d:
C:\Windows\system32>net use y: \\SERVER-PC\VB_scripts_help
The command completed successfully.
C:\Windows\system32>fsutil.exe behavior query Disable8dot3 y:
Error: Access is denied.
Here the FSUTIL behavior query
against a mapped drive raises the Access is denied
error because it can't query remote filesystem (which may not be NTFS
nota bene)...
But even on a local drive with 8dot3
name creation enabled, next example shows that 8.3
names are not solvable unambiguously:
==>D:\bat\StackOverflow\30453582.bat
Directory of C:\testC\New Folder 12
26.05.2015 15:34 0 NEWTEX~1 New Text File 1
26.05.2015 15:34 0 NEWTEX~2 New Text File 2
2 File(s) 0 bytes
Directory of C:\testC\New Folder 21
26.05.2015 15:34 0 NEWTEX~2 New Text File 1
26.05.2015 15:34 0 NEWTEX~1 New Text File 2
2 File(s) 0 bytes
Previous output comes from next batch script:
@ECHO OFF >NUL
MD C:\testC 2>nul
pushd C:\testC
MD "New Folder 12" 2>nul
type NUL>"New Folder 12\New Text File 1"
type NUL>"New Folder 12\New Text File 2"
dir /X "New Folder 12" | findstr /I /V "Volume"| findstr /I /V "<DIR> free"
MD "New Folder 21" 2>nul
type NUL>"New Folder 21\New Text File 2"
type NUL>"New Folder 21\New Text File 1"
dir /X "New Folder 21" | findstr /I /V "Volume"| findstr /I /V "<DIR> free"
popd