What is short-path missing for C:\Program Files? How can I add it back?

10,294

You don't need to create the short name; it's already there.

To verify that it's "PROGRA~1" or determine what it is, use the DIR command, i.e.

CD \
DIR P* /X

which will show you the short names associated with each top-level folder name beginning with "P".

Since "Program Files" and "Program Files (X86)" are protected locations, the system is not going to let you change the short name associated with those folders, but there's no reason you can't use the short names already defined by the system itself.

In addition, your command is for files, and you are managing directories (which in a sense are files, but not to FSUTIL.)

Share:
10,294

Related videos on Youtube

Mike B
Author by

Mike B

Updated on September 18, 2022

Comments

  • Mike B
    Mike B almost 2 years

    Windows 7 (32-bit)

    I have an application that requires short path syntax for a sub-directory under Program Files (c:\Program Files\Foo Example\Foo Example2).

    On MOST of my user systems, it's enabled by default and working fine. However on a select sub-set of users, it's disabled (I'm not sure why since everyone uses a common image).

    I've tried enabling it via fsutil 8dot3name set 0 (from command-prompt using admin privileges). That command seems to run fine (no error). But when I try actually creating the short name I get:

    C:\>fsutil file setshortname "Program Files" PROGRA~1
    Error: Access is denied.
    

    Any thoughts on how to debug this and determine why Windows won't let me add this? Is there an error log I can check somewhere?

    Update

    As per request, here's what I see when typing DIR P* /X

    C:\>DIR P* /X
    Volume in drive C has no label.
    Volume Serial Number is XXXX-XXXX
    
    Directory of C:\
    
    07/13/2009  10:20 PM    <DIR>                       PerfLogs
    03/13/2014  02:47 PM    <DIR>                       Program Files
    03/13/2014  02:48 PM    <DIR>                       Program Files (x86)
    
                  0 File(s)        0 bytes
                  3 Dir(s)  412,723,027,968 bytes free
    
    • Ramhound
      Ramhound about 10 years
      This a internal or third-party application? Because Program Files is not the proper place to place application data hasn't been for a very long time.
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 about 10 years
      Perhaps "PROGRA~1" already exist? Can you CD into it?
    • root
      root almost 10 years
      I may be off here, but would it help to use "SET" (ss64.com/nt/set.html)? Typing SET in cmd may show preset variables such as "ProgramFiles(x86)=C:\Program Files (x86)". In which case, you can use the variable in place of the full path. EG "echo %ProgramFiles(x86)%" will return "C:\Program Files (x86)"
  • Debra
    Debra about 10 years
    Again, run the DIR command I provided, to find out the short name that is already assigned; it doesn't -have- to be "progra~1".
  • Mike B
    Mike B about 10 years
    Hi Debra, I updated the question summary to include the output of that command. No shortcuts display. Any thoughts?
  • Debra
    Debra about 10 years
    Try the following. Run "fsutil 8dot3name query" and determine the state of shortname creation. Check for 3rd-party utilities that might be interfering. Create a non-protected long-name folder and see if the short name creates as well; if not, see if you can add the short name after-the fact. Check if UAC is enabled. There would seem to be something in your install/imaging process that is causing short names to not generate even from initial installation.
  • Debra
    Debra about 10 years
    Hmmm, I also see this social.technet.microsoft.com/forums/windows/en-US/… as noting a problem when imaging with DISM. Is your build process similar?