Go Back  PPRuNe Forums > Misc. Forums > Computer/Internet Issues & Troubleshooting
Reload this Page >

Dealing withLong file names in DOS


Notices
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Dealing withLong file names in DOS

Old 23rd November 2006 | 00:06
  #1 (permalink)  
Thread Starter
Sellby_date Expired
 
Joined: Jan 2003
Posts: 169
Likes: 0
From: East Anglia
Dealing withLong file names in DOS

As a result of something occurring this week (See Burning DVD thread) I need to get into a file in Program Files whilst poking about in DOS.
The problem is, how do I do CD Program Files, as the break is not recognised by the cd command...
This goes of course for any double barrelled file name.
HELP.
terryJones is offline  
Reply
Old 23rd November 2006 | 00:39
  #2 (permalink)  
Thread Starter
Sellby_date Expired
 
Joined: Jan 2003
Posts: 169
Likes: 0
From: East Anglia
Solved my own prob.
Seems that the old win 98 trick of c: \"program files will work ONLY if you get in via CMD and NOT COMMAND.....
We live and learn
terryJones is offline  
Reply
Old 23rd November 2006 | 08:10
  #3 (permalink)  
 
Joined: Oct 2006
Posts: 103
Likes: 0
From: EGBJ Gloucester
Older Windows and DOSs limited filenames to 8 characters, dot, 3 characters - which is known as 8.3 format for obvious reasons. Spaces are not allowed.

Since Windows 95/98 (can't remember which) Windows now uses long filenames (LFN) which can be up to 256 characters and any dots are your own decision.

To convert a LFN to 8.3 format, take the first 6 characters ignoring spaces
and add ~N onto it - where N is usually 1. If there are multiple files in a folder with the same 6 characters prefix, N increments for each of them in alphabetical order. If it is a file, not a folder, you can then append the .xxx extension.

So, "CProgram Files" would become "CProgra~1"
If there was also "CProgram Installers", this would become "CProgra~2".

Ok, enough geeking now...
robdesbois is offline  
Reply
Old 23rd November 2006 | 08:44
  #4 (permalink)  

Plastic PPRuNer
25 Anniversary
 
Joined: Sep 2000
Posts: 1,902
Likes: 0
From: Rochechouart, France
Careful out there. The 8.3 filename is synthesised from the LFN on the fly (it isn't static and isn't stored). The value of ~N depends on what other files there are in the directory/folder.

So mylongappname.exe might be MYLONG~1.EXE in one situation and MYLONG~2.EXE in another.

Old apps that don't understand LFNs can give you serious grief, particularly if they're doing any batch processing. Any files changed to 8.3 will have no idea what their previous LFN was.

LFNTOOLS - http://lfntools.sourceforge.net/ - might be useful to you and LFNDOS and DOSLFN (TSRs that handle long filenames under DOS) are of historical interest.
Mac the Knife is offline  
Reply
Old 23rd November 2006 | 09:17
  #5 (permalink)  
 
Joined: Oct 2006
Posts: 103
Likes: 0
From: EGBJ Gloucester
Originally Posted by Mac the Knife
Careful out there. The 8.3 filename is synthesised from the LFN on the fly (it isn't static and isn't stored). The value of ~N depends on what other files there are in the directory/folder.
Hence I said If there are multiple files in a folder with the same 6 characters prefix, N increments for each of them in alphabetical order.

robdesbois is offline  
Reply
Old 23rd November 2006 | 11:28
  #6 (permalink)  
20 Anniversary
 
Joined: Jun 2001
Posts: 238
Likes: 40
From: Bristol,UK
Or just use dir /x
under_exposed is offline  
Reply

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.