Hi,
Does anyone know how to change the file's short (8.3) name?
I cannnot find the way anywhere including MSDN.
I know how to get the long name and the short name of the files.
(using GetLongPathName() and GetShortPathName())
Unfortunately, what I want to do is not to GET the short file name, but to
SET the short file name.
For example, assume that I create a file named "My Data File.dat".
Then this file is automatically assigned with the short name "MYDATA~1.DAT".
(Of course, the short name is hidden in common condition.)
Now, I want to change the short name to "MDF_01.DAT", how can I do that?
(Sure, the long file name must be kept in its original name.)
I know there is a function SetFileShortName() that may be the one I'm
looking for,
but this function is only available in Windows XP or Server 2003.
(I cannot test this function. My system is Windows 2000.)
Is there no way to solve this problem?
Thanks in advance,
petitehs.
Gary Chanson - 18 Sep 2004 05:22 GMT
> Hi,
>
[quoted text clipped - 20 lines]
>
> Is there no way to solve this problem?
I think that SetShortFileName is the only documented way to change the
short name without changing the long name. I think it would be possible to
write a program which by-passes the file system and changes the short name
in the directory entry directly but I'm not certain that this can be done
without getting the file system confused.

Signature
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@mvps.org
Olof Lagerkvist - 18 Sep 2004 17:53 GMT
>>Hi,
>>
[quoted text clipped - 25 lines]
>
> I think that SetShortFileName is the only documented way to change the
(typo, it is SetFileShortName if he wants to search MSDN for it.)
> short name without changing the long name. I think it would be possible to
> write a program which by-passes the file system and changes the short name
> in the directory entry directly but I'm not certain that this can be done
> without getting the file system confused.

Signature
Olof Lagerkvist
ICQ: 724451
Web page: http://here.is/olof
RNEELY - 21 Sep 2004 14:53 GMT
The Visual Basic File System Object "File" Object gives you both short an
long filenames. You can get to it directly from VB or VBScript, or in C++
via COM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vb
conprogramminginfsoobjectmodel.asp
> Hi,
>
[quoted text clipped - 24 lines]
>
> petitehs.
Eskimo - 21 Sep 2004 15:26 GMT
Try fsutil utility.
> Hi,
>
> Does anyone know how to change the file's short (8.3) name?
> I cannnot find the way anywhere including MSDN.
Roger Frei - 24 Nov 2004 15:01 GMT
"Eskimo" schrieb:
> Try fsutil utility.
>
> > Hi,
> >
> > Does anyone know how to change the file's short (8.3) name?
> > I cannnot find the way anywhere including MSDN.
Hi
I've try
fsutil file setshortname C:\Programme Progra~1
but I held a Error Message.
How can I change a short name for a system folder??
Thank's for help
Roger