Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS Commands in Win2000 1

Status
Not open for further replies.

vbMax

Programmer
Jul 16, 2001
92
0
0
US
Some DOS commands are acting strange for me in
Windows 2000. Does anyone know of a way to
make DOS act as it does in Windows 95/98?
Specifically, I am looking for solutions to
the following two problems:

1) DOSKEY does not work.

2) I am unable to use the change directory
command to get to c:\My Documents. I have
tried: cd \My Documents
cd My Documents
cd \"My Documents"
cd "\My Documents"
I get a "Too many parameters" error message.
However, I can do: cd \WINNT

Thanks in advance.
 
My documents is not on the C: drive. It is a subfolder under Documents and Settings then your user ID or Administarator (depending on how you login) then you will find the My Documents folder there. James Collins
Systems Support Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
The command cd behaves quite the same 9x as nt/2000. Not only not under C: drive, My Documents is nowhere as far as cd is concerned. It is not recognized by it. It is not an object dos recognizes. (You can't go there in win98 either, can you ?)

regards - tsuji
 
CD works fine in Win2K. Its just that My Documents is not redily available on the C: Drive. My Documents is user specific. That means that each user logged in will have their own, not a public accessable are. Its under the Documents and Settinds folder under your login name (If you login under Administrator then its under there.

Under a pure DOS environment the My Documents folder would be listed as mydocu~1
James Collins
Systems Support Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
For clarification, I created a folder in my root directory
name "My Documents" (I am not using the one under Documents
and Settings).

When I issue the command "cd \mydocu~1" it works! It seems
that the 8.3 name format is being used. My next question
is how can I determine the 8.3 file name from the "long"
file name that is displayed in Windows Explorer?
 
try typing in the full command, for example:
cd\winnt\program files\my documents
seemed to work for me. Good luck!

Julie s-) I came, I saw, I connected at 48.8...
 
It will ALWAYS be the first SIX letters then the ~ sighn followed by a number (usually 1 unless multiple folders exist ie... My Documents,My Documents1, My Documents2 and so on. Then the 8.3 name would be mydocu~1, mydocu~2, and so on. Hope this helps. James Collins
Systems Support Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
[1] Well placed quotation marks, " ... ", for long file name with spaces inside usually get you the right place if cd is used properly in the first place. Hence, there is no problem there. Problems do arise if the long file name gets really long and it is laborous to type it at cmdline prompt at interactive box. Then usually you can use dir to help you learn the exact 8.3 alias the system recognizes and use it accordingly.

[2] The real problem arise within batch jobs and programs which accept only 8.3 filename as parameters. Here you have to be more careful.

[3] This is what MS advise the good practice of LFN.

Quote
8.3 file name aliases may change when you copy files from one folder to another for a number of reasons. If you must use 8.3 file names, it may be best not to give the files LFNs. Also, it is good practice not to use LFNs that create a large number of similar 8.3 aliases. For example, instead of using a "Month end report for January.txt" file name, use "January month end report.txt" for the file name. As a result, the "February month end report.txt" file generates a significantly different 8.3 alias.
Unquote
Ref : Q226403

[4] Now, the truely delicate issue is the modification MS used in the implementation of algorithm in generating 8.3 alias of LFN. MS uses a different algorithm for win2000 in comparison with win9x. The is what MS has to say.

Quote
Windows 2000 uses a different algorithm for creating short (8.3) file name aliases for LFNs than does Windows 95 or Windows 98. Windows 95/98 and Windows 2000 all create 8.3 aliases by using the first six characters of the file name and appending "~1" (or another number). For example, the "Month end report for January.txt" file name becomes Monthe~1.txt.
However, unlike Windows 95/98, if more than four files result in the same first six characters, Windows 2000 uses a different procedure starting with the fifth file. Windows 2000 then:
* Uses the first two letters of the long file name.
* Generate the next four letters of the short file name by manipulating the remaining letters of the LFN.
* Appends "~1" (or another number).
For example, the "Month end report for January.txt" file name may become Modrjy~1.txt.
Unquote
Ref Q226403

Amazingly complicate, is it not?

Ref :

Regards - tsuji
 
tsuji,

You are correct in your explanation. I think it is though a little in-depth for most users who may never need to know that. But hey i like the article and learned something I did not know myself. :) I am learning, so be patient.
 
Nice article tsuji. That is something I also did not know. I will remember that. Did you get that from the MS site? James Collins
Systems Support Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
Thank you, everyone, for your input!
X-)
 
Hello, fellows.

Glad you like my digestion of what MS official knowledge base article. MSKB is where one has always to refer to over thousands of tech sites out there which give out advices and generate, sometime unintentionally, myths and legends.

regards - tsuji
 
I discovered the "switch" on the DIR command that I was
looking for. "DIR /x" will list both the long AND short
file names.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top