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

Dealing withLong file names in DOS

Wikiposts
Search
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

Thread Tools
 
Search this Thread
 
Old 23rd Nov 2006, 00:06
  #1 (permalink)  
Sellby_date Expired
Thread Starter
 
Join Date: Jan 2003
Location: East Anglia
Age: 83
Posts: 169
Likes: 0
Received 0 Likes on 0 Posts
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  
Old 23rd Nov 2006, 00:39
  #2 (permalink)  
Sellby_date Expired
Thread Starter
 
Join Date: Jan 2003
Location: East Anglia
Age: 83
Posts: 169
Likes: 0
Received 0 Likes on 0 Posts
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  
Old 23rd Nov 2006, 08:10
  #3 (permalink)  
 
Join Date: Oct 2006
Location: EGBJ Gloucester
Age: 40
Posts: 103
Likes: 0
Received 0 Likes on 0 Posts
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  
Old 23rd Nov 2006, 08:44
  #4 (permalink)  

Plastic PPRuNer
 
Join Date: Sep 2000
Location: Cape Town
Posts: 1,898
Received 0 Likes on 0 Posts
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  
Old 23rd Nov 2006, 09:17
  #5 (permalink)  
 
Join Date: Oct 2006
Location: EGBJ Gloucester
Age: 40
Posts: 103
Likes: 0
Received 0 Likes on 0 Posts
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  
Old 23rd Nov 2006, 11:28
  #6 (permalink)  
 
Join Date: Jun 2001
Location: Bristol,UK
Posts: 225
Received 11 Likes on 7 Posts
Or just use dir /x
under_exposed is offline  

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



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

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