1

I associated a file extension using the command assoc. But in the Explorer, it lists the type as the extension name. I.e. assoc .sh=ShellScript will still cause explorer to show the type as SH File.

Anyway to change it so it shows up as ShellScript or better yet, Shell Script?

EDIT:

Using assoc didn't work. Seems to be something wrong with my registry. I figured that using quotes would put in a white space, but because it didn't show up in the explorer, I figured it may have been part of the problem.

3 Answers 3

3

I recommend that you do not add spaces to the ProgID (that's the string on the right side of the equals sign when you use assoc), even though assoc and ftype may (partially) support it. Read my answer here for details.

The proper way to do it is to use a ProgID without spaces, and to set the (Default) as well as the FriendlyTypeName for the ProgID to the description you want via the registry:

[HKEY_CLASSES_ROOT\.txt]
@="txtfile"
"PerceivedType"="text"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\txtfile]
@="Text Document"
"FriendlyTypeName"="Text Document"

If all that registry editing seems too complex to you, you can easily use something like FileTypesMan to set the Description as follows:

1

2

1

I just experimented myself with the assoc command, it turns out the Explorer shows exactly what I put after the equal sign as file type. I'm also on Windows 7. Maybe you can try log out and log in again.

For adding the space in the middle, you can quote the name.

assoc .sh="Shell Script"
2
  • Hrm, you're right. Must have broken something in the registry. It worked with another unused extension. Now how to fix...?
    – Adrian
    Commented Jun 28, 2013 at 18:37
  • 1
    @Adrian Besides editing the registry under HKEY_CLASSES_ROOT, you may try this little application suggested by a MVP in this thread. You can edit names of each extension.
    – chyiz
    Commented Jun 28, 2013 at 19:39
0

you done right, just put double quotes if you want space between two words, i have tried on my laptop,

assoc .foo="Foo bar file"

and it just works, immediately,

if still not changing run cmd.exe as an Administrator otherwise it will display Access Denied.

CMD output :

C:\Windows\System32\>assoc .bar="Foo bar file"
.bar=Foo bar file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .