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

0

1

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

Mike B

Posted 2014-04-25T15:54:04.573

Reputation: 2 308

I may be off here, but would it help to use "SET" (http://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)"

– root – 2014-07-09T14:59:47.887

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. – Ramhound – 2014-04-25T16:01:45.007

Perhaps "PROGRA~1" already exist? Can you CD into it? – Ƭᴇcʜιᴇ007 – 2014-04-25T16:04:06.963

Answers

2

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.)

Debra

Posted 2014-04-25T15:54:04.573

Reputation: 4 000

Thanks for the prompt response. That's just it though - if I try C:\>cd c:\progra~1I get a response of The system cannot find the path specified" – Mike B – 2014-04-26T22:15:25.197

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". – Debra – 2014-04-27T14:38:47.690

Hi Debra, I updated the question summary to include the output of that command. No shortcuts display. Any thoughts? – Mike B – 2014-05-01T23:16:40.307

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 – 2014-05-02T05:46:17.173

1

Hmmm, I also see this http://social.technet.microsoft.com/forums/windows/en-US/46cd3ef4-ed79-4b87-9e0f-6d769da9b9b9/dismexe-commit-breaks-program-files-8dot3-short-names as noting a problem when imaging with DISM. Is your build process similar?

– Debra – 2014-05-02T06:15:03.167

0

  1. Run Windows in Safe Mode with Command Prompt to make sure Windows is not using Program Files
  2. cd C:\
  3. fsutil file setshortname "Program Files" PROGRA~1

Pavulon

Posted 2014-04-25T15:54:04.573

Reputation: 1