Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Coverting a directory name to 8 char format

Posted on 2003-12-01
4
Medium Priority
?
380 Views
Last Modified: 2008-03-03
I need to know how to covert this: d:\Reseller Domains\Marin Market\ into a old dos format.  I got this far: d:\resell~1\ BUT I cant figure out how do do the next folder because the 6th character is a space.  I CANT change the folder name....it is not an option.

This is urgent and any help is appreciated.
0
Comment
Question by:truckfanatic_com
4 Comments
 
LVL 1

Author Comment

by:truckfanatic_com
ID: 9855979
The title was supposed to be converting :) DOH!
0
 
LVL 85

Accepted Solution

by:
oBdA earned 600 total points
ID: 9856788
Simply use "dir /x" in a command shell to obtain the short name of a directory or file name.
0
 
LVL 30

Assisted Solution

by:SteveGTR
SteveGTR earned 200 total points
ID: 9857184
Try this in NT and XP:

@echo off

echo %~s1

Example:

shortname "d:\Reseller Domains\Marin Market\"

shortname would be the name of the batch file.

Good Luck,
Steve

0
 
LVL 3

Assisted Solution

by:royce2020
royce2020 earned 200 total points
ID: 9861847
if you are using DOS 6.0+ (2K & XP posibly NT as well but I'm not sure) this folder will be called
d:\resell~1\marinm~1\
spaces are ignored in this version of dos
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses

886 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