Solved

Coverting a directory name to 8 char format

Posted on 2003-12-01
4
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 150 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 50 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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