Solved

Converting Windows file names to DOS file names

Posted on 2000-02-17
8
146 Views
Last Modified: 2013-12-29
I write some batch files in Win98 that copies files.  I understand how DOS shortens Window file names, but I don't understand how to handle spaces in the Window file name.  Can someone help?
0
Comment
Question by:Gregg011299
8 Comments
 
LVL 21

Expert Comment

by:briancassin
ID: 2533044
space are underscores like for install set me.doc in windows 98 would be like set_me.doc in dos
0
 

Author Comment

by:Gregg011299
ID: 2533071
I tried that, but it did not work.  In the mean time, I did some more research and discovered my own answer, which works.
CMDB be.mdb in Win98 becomes CMDBbe~1.mdb in DOS
0
 
LVL 22

Expert Comment

by:cookre
ID: 2533324
If you are computing the short names, don't forget to check any given  proposed short name to see if it already exists.  If it does, you'll have to increment the digit after the ~ and iterate until you get a unique name.  And, if you find 9 duplicates, you have to chop the end of the proposed short base and start into double digits after the ~.

Or, if this is for use in DOS under 95, just put the fully qualified long name in double quotes.  For example:

copy "c:\big long file name.thing"  shrt.dat

works just fine.
0
 

Expert Comment

by:itssook
ID: 2533463
Instead of using spaces just combine the words and shorten it to 8 characters.

So instead of doing: my word story.doc dos omething like wordstry.doc and that will work.
0
Do email signature updates give you a headache?

Are you constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 
LVL 22

Expert Comment

by:cookre
ID: 2533541
itssook:  The convention at EE is to post comments only.  Most folks don't bother looking at questions that have been locked by a proposed answer, thereby denying the questioner extra exposure.  I see you're new here, so don't worry about it - it's a common occurance.





0
 

Author Comment

by:Gregg011299
ID: 2536871
That doesn't answer my question--it is merely a workaround for the situation. I don't want to rename the file since several PC's refer to it and the links would have to be updated.

Cookre gave the most information to date--a questions though.  Does 98SE use the double quotes around the file names just as 95?
0
 
LVL 22

Accepted Solution

by:
cookre earned 50 total points
ID: 2537171
Yup. The sample I gave above I ran on 98 just to make sure.
0
 

Author Comment

by:Gregg011299
ID: 2538259
Cookre -- You got the answer.  I tested it in my batch file and it works.  I thought I tried that before, but guess I didn't.  That's a much better way of handling the situation than the one I came up, so you deserve the points.

Thanks, Gregg
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asset management of client side devices laptops/computers 1 45
adobe acrobat scaning 9 50
prezi for presentation 2 45
Problem to error 4 45
A few months ago I had an issue with LaserJet 1020 printer which was installed to XP and Windows 7.  It was installed to XP and working, but when I tried to connect from a Windows 7 PC, it would attempt connection and then fail.  Sometimes the Spool…
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now