Solved

dos command didnt work

Posted on 2007-12-03
5
461 Views
Last Modified: 2008-02-26
Hi,
I'm trying to access this folder but it didn't work, so how will the folder name in DOS??



C:\Documents and Settings\bilbo>dir C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\
The system cannot find the file specified.

C:\Documents and Settings\bilbo>
0
Comment
Question by:motioneye
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Limbeck
ID: 20394453
try something like

dir C:\Progra~1\Micros~1\MSSQL.1\MSSQL\Backup\
 
0
 
LVL 83

Assisted Solution

by:oBdA
oBdA earned 500 total points
ID: 20394547
Whenever you need to specify a path containing spaces in a command line, you need to enclose it in quotes:
dir "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"
If you want to use short names, you can retrieve these with a "dir /x".

Limbeck,
the short name of a folder or a file is *not* necessarily "<First 6 letters>~1"!
If Microsoft Office (or anything else creating a folder starting with "Microsoft" has been installed first, then this will already have used ~1, with the SQL installation then being ~2 or whatever.
So these paths are valid *only* for the one single machine on which you tested it, they can *not* be used on another machine!
0
 
LVL 2

Expert Comment

by:Dominik_L
ID: 20394581
DOS folder name is limited to the 8-characters. If the name is longer than 8 characters or have spaces in the name than name is 6 characters of the name and usually "~1" (sometimes "~2" and so on) on the end with spaces cutted out.
It will be easier to download Dos Navigator: http://www.ritlabs.com/download/dn/dn151.zip
(its a free file manager for DOS, but works under windows).
Unzip files where you want and run DN.COM.
You will see folders in a 8-characters way with "~" and you will be able to see the name of every folder.
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 20394617
Dominik_L,
the path in question here is for an SQL server, SQL server doesn't run on DOS, so this question is obviously not about DOS, but about the NT command shell, usually mislabeled as "DOS Box" (though it has nothing at all to do with plain DOS, except that they look alike).
Running 16 bit DOS programs like the one you're recommending is not a good idea on any 32bit Windows installation, because the DOS emulation uses way too many resources. Open a command window, type "edit" and type something; you'll see the CPU going berserk - just to work on a few characters.
0
 
LVL 2

Expert Comment

by:Dominik_L
ID: 20401604
oBdA,
you're right, but I still think that its not a problem to run Dos Navigator for 1 minute to get the correct short names of folders on the searched path. Sometimes it's very usefull.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 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

21 Experts available now in Live!

Get 1:1 Help Now