I have a problem with windows windows shortnames. Sometimes the short names do not seem to be generated for "Program Files" and "Program Files (x86)".
I verified that short name generation is enabled with fsutil behavior query disable8dot3 C:
which tells me that the system wide setting is 2
(per volume) and the local value is 0
(create 8dot3 names).
It should look roughly like this (note that is is a german 32bit copy):
C:\>dir /a /x
Verzeichnis von C:\
21.12.2011 00:17 <DIR> $Recycle.Bin
14.07.2009 05:53 <VERBINDUNG> DOCUME~1 Documents and Settings [C:\Users]
09.01.2011 15:35 <VERBINDUNG> DOKUME~1 Dokumente und Einstellungen [C:Users]
27.11.2013 15:11 2.147.016.704 pagefile.sys
14.07.2009 03:37 <DIR> PerfLogs
26.11.2013 17:31 <DIR> PROGRA~1 Program Files
08.11.2013 21:58 <DIR> PROGRA~2 ProgramData
09.01.2011 15:35 <VERBINDUNG> PROGRA~3 Programme [C:\Program Files]
09.01.2011 15:35 <DIR> Recovery
26.11.2013 17:40 <DIR> SYSTEM~1 System Volume Information
23.01.2011 15:00 <DIR> Temp
11.01.2011 20:56 <DIR> Users
08.11.2013 14:53 <DIR> Windows
However on another machine (64bit copy), this looks like C:>dir /a /x
Verzeichnis von C:\
21.12.2011 00:17 <DIR> $Recycle.Bin
14.07.2009 05:53 <VERBINDUNG> DOCUME~1 Documents and Settings [C:\Users]
09.01.2011 15:35 <VERBINDUNG> DOKUME~1 Dokumente und Einstellungen [C:Users]
27.11.2013 15:11 2.147.016.704 pagefile.sys
14.07.2009 03:37 <DIR> PerfLogs
26.11.2013 17:31 <DIR> Program Files
26.11.2013 17:31 <DIR> Program Files (x86)
08.11.2013 21:58 <DIR> ProgramData
09.01.2011 15:35 <DIR> Recovery
26.11.2013 17:40 <DIR> SYSTEM~1 System Volume Information
23.01.2011 15:00 <DIR> Temp
11.01.2011 20:56 <DIR> Users
08.11.2013 14:53 <DIR> Windows
As you might have noticed, the short names are missing for the program folders.
The question is now how to generate them, because I need those short names for a few older scripts.
I tried with fsutil file setshortname "Program Files" "PROGRA~1"
, but this just gives me Access denied.
.
Program Files
. It's not possible to adjust the scripts? Also, i hope the script is not thinking theProgram Files
-directory is alwaysPROGRA~1
because if that's the case your script will run in some serious trouble eventually because the short-names are not always the same. You could also ask for help upgrading the scripts to the long-name (instead of the short-name) findfirst etc. (if at all possible).%programfiles%
). Renaming does indeed not work. Maybe I can do this from offline? Could be a work-around.