Solved

Coverting a directory name to 8 char format

Posted on 2003-12-01
4
353 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 83

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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

18 Experts available now in Live!

Get 1:1 Help Now