Hi All,
I wrote a program that uses File.DirApp to get the application directory. On one computer Win 64 Bit Professional. iI returned the full filename on another with same operating system it returned the short filename.
Of course the operating system can use both, but us humans have problems with this. I did a bit of Googling and found that you can control the use of long and short filenames using either a utility or a bit of registry editing. Viz:
fsUtil
fsutil 8dot3name
ftype
Registry Setting
To cut a long story short, I turned off the short filenames using:
OR
Note that only files that are created after the command iS executed are affected.
I then stripped the short filenames out of my directory using:
This fixed the problem.
Have a look in mylogfile.log to see what was done by this command.
WARNING
You need to be careful with this. If you have legacy software that need short filenames then you have to either turn on short filenames for all volumes or turn it on for only those volumes or directories that the legacy program uses.
Short filenames slow down the file system a bit and that's why it's often turned of on file servers. The speed difference probably won't be discernible on a workstation PC, so I wouldn't turn short filenames off to try and speed things up.
I wrote a program that uses File.DirApp to get the application directory. On one computer Win 64 Bit Professional. iI returned the full filename on another with same operating system it returned the short filename.
Of course the operating system can use both, but us humans have problems with this. I did a bit of Googling and found that you can control the use of long and short filenames using either a utility or a bit of registry editing. Viz:
fsUtil
fsutil 8dot3name
ftype
Registry Setting
To cut a long story short, I turned off the short filenames using:
Bash:
title="Command to Set NTFS short filename handling;"]To disable 8.3 name creation on all NTFS partitions, type fsutil.exe behavior set disable8dot3 1 at an elevated command prompt, and then press Enter.
This operation takes effect immediately (no restart required).
Notes
When a volume is not specified, the operation updates the registry value:
0 - Enable 8dot3 name creation on all volumes on the system
1 - Disable 8dot3 name creation on all volumes on the system
2 - Set 8dot3 name creation on a per volume basis
3 - Disable 8dot3 name creation on all volumes except the system volume
When a volume is specified, the operation updates the individual volume's on disk flag. This operation is meaningful only if the registry value is set to 2.
0 - Enable 8dot3 name creation on this volume
1 - Disable 8dot3 name creation on this volume
OR
Changeing Short Fielnames in Registry:
322756 How to back up and restore the registry in Windows
Start Regedt32.exe and locate the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Select the NtfsDisable8dot3NameCreation entry.
Note By default, the value for this entry is set to 0.
On the Edit menu, click DWORD. Type a value of 1 in the Data field.
Click OK and then exit Regedt32.
Exit Windows NT, and then shut down your computer.
Restart your computer and Windows NT.
NOTE: The change to the NtfsDisable8dot3NameCreation registry entry affects
only files, folders, and profiles that are created after the change.
Files that already exist are not affected.
Note that only files that are created after the command iS executed are affected.
I then stripped the short filenames out of my directory using:
Strip Out Short Filenames:
'Command
fsutil 8dot3name [strip] [/t] [/s] [/f] [/l [<log file.] ] [/v] <directorypath>
'Example
fsutil 8dot3name strip /l mylogfile.log /s C:\B4X\B4J
This fixed the problem.
Have a look in mylogfile.log to see what was done by this command.
WARNING
You need to be careful with this. If you have legacy software that need short filenames then you have to either turn on short filenames for all volumes or turn it on for only those volumes or directories that the legacy program uses.
Short filenames slow down the file system a bit and that's why it's often turned of on file servers. The speed difference probably won't be discernible on a workstation PC, so I wouldn't turn short filenames off to try and speed things up.