Converting to 8.3?

#1
I have files buried in long fiilename folders, and I want to have a btm file that uses short (8.3) paths.

Is there an easy / convenient way to create a btm file that would copy from / to folders using an 8.3 format without disrupting the file / folder structure?

Regards,
Chuck Billow
 
May 20, 2009
231
1
53
ITALY
#2
I have files buried in long fiilename folders, and I want to have a btm file that uses short (8.3) paths.
I have not an answer, but only a warning for You.
Be careful when You choose the tool and the way of using it, because You might destroy some files on the target.
I saw it happen with robocopy, for example in this situation.
On the source there is a "LongFileName.txt" file, hidden short name is "longfi~2.txt".
There is also a file with only a short name, "longfi~1.txt".
Maybe this file came from a damage that in the past destroyed its long name, I do not know.
Anyway, You start a copy from the source to the empty target.
You copy first the "LongFileName.txt" file, and on the target its hidden short name becomes "longfi~1.txt".
When You copy the second file, "longfi~1.txt", it overwrites the first file.
This might depend on the order in which files are copied, their short names, if You said to overwrite on the target, and so on.
I am afraid that the same might happen for whole folders.

Regards

Rodolfo Giovanninetti
 

samintz

Scott Mintz
May 20, 2008
1,270
11
Solon, OH, USA
#3
try this:
Code:
function relpath=`%@right[-%@len[%_cwds],%1]`
do f in /p pdir /a:-d /sb /(@relpath[%%%%@sfn[*]]) All\ (copy /y /md %f Foo\%f)
I had issues with TCC not being able to copy the SFN. TCC claims it can't find the file. If I add an echo in front of the copy to see the copy command it all looks okay to me.

BTW, Why do you need to do this?
 
#6
Chuck:
Heed the warning in Rodolfo's post.

I reiterate Scott's question: why the need?

If all you want is copy all files in a (sub)tree using only their SFNs, without the target having the LFNs, Scott's method will do it.

However, if you need both the LFNs and the SFNs in the target directory to match those in the source, you are totally out of luck. NTFS does not support it. Files that are cataloged in a directory with a long file name (i.e., with names not 8.3 OR names including characters not legal for SFN) are assigned an SFN at the instant they are cataloged, one at a time; the SFN assigned depends on the LFN, on SFNs already existing in the directory at that moment, and on the SFN generation algorithm which in turn is dependent on the target machine's Windows/NTFS version.