Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

How to recreate short file names


Phenomic
 Share

Recommended Posts

I have an installation where "Program Files" and "Documents and Settings" have no short filenames. I know how the short filenames were destroyed but don't know how to recreate them. A running OS won't let you rename them, so I renamed them in Recovery console, but still no SFNs. Any ideas?

Link to comment
Share on other sites


I have an installation where "Program Files" and "Documents and Settings" have no short filenames. I know how the short filenames were destroyed but don't know how to recreate them. A running OS won't let you rename them, so I renamed them in Recovery console, but still no SFNs. Any ideas?

What is the output of

DIR /X

? :unsure:

Is it a NTFS filesystem?

What is the content of HKLM\\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation (if any?)

http://support.microsoft.com/kb/210638/en-us

jaclaz

Link to comment
Share on other sites

Dir /x shows no SFNs, NtfsDisable8dot3NameCreation = 0

Hmmm.

  1. What EXACTLY have you attempted in the RC?
  2. Can you try with a more "complete" environment such as a PE?
  3. Have you tried renaming including a "forbidden" char in the filename?
    http://support.microsoft.com/kb/142982/en-us
  4. Have you tried using Unlocker (or a similar tool) to allow the renaming in the "fully booted" OS? (beware, risk of crash :ph34r: )
    http://www.softpedia.com/get/System/System-Miscellaneous/Unlocker.shtml
  5. How EXACTLY were the filenames destroyed?
  6. Do the short filenames appear for newly made files/directories in the running system?

In the worst case you can still manually hex-write them with a tool like DMDE. (you will need to know where your towel is )

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

I have 2 storage dirs, one has all the files needed by W7 and the other Win2k. I move one OS out to storage and the other one in, and vice versa, so I share the partition between 2 OSes, follow? I do the moving in Linux, that’s how the SFNs get destroyed.

I thought renaming to something else and back would re-create the SFNs.

Link to comment
Share on other sites

I edited the previous post, numbering the questions.

Right now we have ONLY 1/6th of the answers (not counting the unanswered questions in the previous post) :

5. I have 2 storage dirs, one has all the files needed by W7 and the other Win2k. I move one OS out to storage and the other one in, and vice versa, so I share the partition between 2 OSes, follow? I do the moving in Linux, that’s how the SFNs get destroyed.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

I edited the previous post, numbering the questions.

Right now we have ONLY 1/6th of the answers (not counting the unanswered questions in the previous post) :

5. I have 2 storage dirs, one has all the files needed by W7 and the other Win2k. I move one OS out to storage and the other one in, and vice versa, so I share the partition between 2 OSes, follow? I do the moving in Linux, that's how the SFNs get destroyed.

jaclaz

I ran the following batch in recovery console. So renaming doesn't generate SFNs!?

set AllowAllPaths = True

ren "Documents and Settings" "Documents and Settings1"
ren "Program Files" "Program Files1"
ren "Documents and Settings1" "Documents and Settings"
ren "Program Files1" "Program Files"

Link to comment
Share on other sites

lol, I was hoping somebody would give me answers, like some utility that re-generates SFNs.

But you didn't ask for answers or tools, you asked for ideas instead:

I have an installation where "Program Files" and "Documents and Settings" have no short filenames. I know how the short filenames were destroyed but don't know how to recreate them. A running OS won't let you rename them, so I renamed them in Recovery console, but still no SFNs. Any ideas?

anyway a suitable tool has been suggested, DMDE:

http://softdm.com/

(and yes, I know that next post will be asking an "automagic" tool capable of fixing those names ;))

Maybe fsutil would do:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil_file.mspx?mfr=true

To set the short name for the file longfilename.txt on drive C to longfile.txt, type:

fsutil file setshortname C:\longfilename.txt longfile.txt

cannot say if it works on dirctories as well :unsure:

jaclaz

Link to comment
Share on other sites

  • 8 years later...

Sorry to bump this thread up, but I encountered the same problem, and I thought someone else might have it.

I ended up writing a simple command line program that re-generate the short-names automatically for a files and folder.

See https://github.com/RamonUnch/ssname/

If you want binary/source.

It is not following the exact same convention than windows but it is convenient to fix ntfs-3g copied files so that they have a short name that can be used later...

It will not reproduce the same short-name than what windows did because it would be impossible anyway.

For special names such as "Program Files" you should do it manually.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...