Questions tagged [short-filenames]

An 8.3 filename (also called a short filename or SFN) is a filename convention used by old versions of DOS, versions of Microsoft Windows prior to Windows 95, and Windows NT 3.51.

Short filenames are limited to at most eight characters (after any directory specifier), followed optionally by a filename extension consisting of a period . and at most three further characters. For systems that only support 8.3 filenames, excess characters are ignored and if a file name has no extension, the ., if present, has no significance (that is, myfile and myfile. are equivalent). Furthermore, in these systems file and directory names are uppercase, although systems that use the 8.3 standard are usually case-insensitive (hence CamelCap.tpu will be equivalent to the name CAMELCAP.TPU). However, on non-8.3 Operating Systems (such as almost any modern Operating System) accessing 8.3 File Systems (including DOS-formatted diskettes, but also including some modern memory cards and networked file systems) the underlying system may alter filenames internally to preserve case and avoid truncating letters in the names, for example in the case of VFAT.


Source: Wikipedia

28 questions
36
votes
3 answers

Convert long filename to short filename (8.3) using cmd.exe

I am trying to convert a long filename to a short filename (8.3) on Windows. A batch-file with a command line argument works as intended: short.bat: @echo OFF echo %~s1 calling short.bat C:\Documents and Settings\User\NTUSER.DAT returns…
user1251007
  • 15,891
  • 14
  • 50
  • 76
15
votes
4 answers

How can I convert a Windows short name path into long names within a batch script

I am writing a Windows batch script, and I have an argument or variable containing a path that uses short 8.3 names. The path might represent a file or folder. How can I convert the 8.3 path into a long-name path? At a minimum I would like to be…
dbenham
  • 127,446
  • 28
  • 251
  • 390
12
votes
5 answers

How does Windows determine/handle the DOS short name of any given file?

I have a folder with these files: alongfilename1.txt <--- created first alongfilename3.txt <--- created second When I run DIR /x in command prompt, I see these short names assigned: ALONGF~1.TXT alongfilename1.txt ALONGF~2.TXT…
Matt Refghi
  • 791
  • 2
  • 12
  • 27
10
votes
2 answers

How to get short-filenames in Windows using Java?

How to get the short-filename for a long-filename in Windows using Java? I need to determine the short-filenames of files, stored on a Windows system, using Java(tm).
Osmund Francis
  • 771
  • 10
  • 27
10
votes
3 answers

What's the advantage of having an 8-letter process?

If you run Sticky Note in Windows 7,its process, is called StikyNot.exe. Several other Windows processes keep their process names under 8 letters. Why do they do that? What is the advantage? Are they just clinging to the past? Or should…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
8
votes
1 answer

JSON 3-letter file extension convention

RFC7159 states that the file extension to a stored JSON file should be .json. I work with a file system with only 3-letter file extension. Is there any commonly accepted file extension for a JSON file in such systems? As no 3-letter convention…
Baard
  • 809
  • 10
  • 26
5
votes
3 answers

Delete file with specific extension in batch file

I would like to recursively delete all files with a specific extension in a batch file. I am aware of the following command: del /s *.ext However, this does on Windows also delete files with other extensions like e.g. .ext1 or .ext2 . The reason…
FourtyTwo
  • 1,616
  • 2
  • 15
  • 43
5
votes
2 answers

Git 'filename too long' error on OS X

I have a directory that is tracked by git on linux and I copied it to mac OS. On git status multiple files are untracked because of a filename: File name too long error. One filename (with its relative path) is 393 characters. Isn't there a limit…
4
votes
2 answers

How to convert file name with path to short file name (DOS style) in Adobe AIR?

How to convert file name with path to short file name (DOS style) in Adobe AIR? For example convert next path "C:\Program Files\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR…
Maksym
  • 353
  • 1
  • 5
  • 14
4
votes
1 answer

Java call for Windows API GetShortPathName

I'd like to use native windows api function in my java class. The function I am interested in is GetShortPathName. http://msdn.microsoft.com/en-us/library/aa364989%28VS.85%29.aspx I tried to use this -…
norbi771
  • 814
  • 2
  • 12
  • 29
3
votes
2 answers

How to set FAT32 short names in Powershell or Windows Command Shell

I need to write a script that sets the short name of a file on a FAT32 file system. On NTFS I can use the FSUTIL utility under windows but I cannot seem to fathom out how to do this for a FAT32 drive. Bonus kudos for a window command or powershell…
Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
3
votes
3 answers

Convert long filename to short filename (8.3)

I want to convert long filenames/path to short filenames (8.3). I'm developing a script that calls a command line tool that only accepts short filenames. So i need to convert C:\Ruby193\bin\test\New Text Document.txt…
user1251007
  • 15,891
  • 14
  • 50
  • 76
2
votes
1 answer

Does Delphi treat .exe files differently based on filename length?

I am currently developing an internal tool using Delphi. If I call the project and therefore the .exe RecUtil It runs fine with no intervention. However if I name the project RecUpdate It requires user intervention to allow it to run. This is a…
Toby Allen
  • 10,997
  • 11
  • 73
  • 124
2
votes
2 answers

How are Short File Names generated in Windows?

I am currently using the following P/Invoke signature to get the short filename of a regular Windows file: [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern int GetShortPathName([MarshalAs(UnmanagedType.LPTStr)] string path, …
unknown6656
  • 2,765
  • 2
  • 36
  • 52
1
vote
1 answer

How to get folder names with ~ in PowerShell

I have this code in PowerShell $workingDir = $PSScriptRoot + "/" This will give me the path to the current ps1 file. I am later on referencing this working Directory variable to refer to sub folders and to run some old 1990's style programs. My…
1
2