DOS shell start at U:\ instead of C:\

  • Thread starter Thread starter wong_powah
  • Start date Start date
W

wong_powah

The windows 2000 DOS shell start at U:\ instead of C:\.
How to make it start at C:\?
I had set environment variables as follows but they do not work:
HOMEDRIVE=C:
HOMEPATH=C:
and also
HOMEDRIVE=C:\
HOMEPATH=C:\
 
The windows 2000 DOS shell start at U:\ instead of C:\.
How to make it start at C:\?
I had set environment variables as follows but they do not work:
HOMEDRIVE=C:
HOMEPATH=C:
and also
HOMEDRIVE=C:\
HOMEPATH=C:\

DOS is an operating system, same as Linux or Windows.
You're probably referring to the Command Prompt under
Windows 2000.

How do you start the Command Prompt? Using a shortcut
would give you the greatest flexibility, such as the starting
drive/folder. You could also specify this command to make
the Command Prompt even more useful:

cmd.exe /f:on /k mode con lines=50
 
Right click on the Command Prompt shortcut and select Properties. In the
Shortcut tab, you can change/select where you want it to start in.

You can use environmental variables or actual drive and directory names. One of
mine is set as C:\ and another is %HOMEDRIVE%%HOMEPATH%
 
Right click on the Command Prompt shortcut and select Properties. In the
Shortcut tab, you can change/select where you want it to start in.

You can use environmental variables or actual drive and directory names. One of
mine is set as C:\ and another is %HOMEDRIVE%%HOMEPATH%

I change %HOMEDRIVE%%HOMEPATH% to C:\%HOMEPATH%.
I set HOMEPATH=win44
The Windows command prompt start at "C:\" instead of "C:\win44".
How to fix this problem?
 
Since you set HOMEPATH to win44, it's doing exactly what you're asking for.

Why don't you simply change the "start in" value to C:\ and forget about using
any variable?
 
(e-mail address removed) wrote in
ups.com:
I change %HOMEDRIVE%%HOMEPATH% to C:\%HOMEPATH%.
I set HOMEPATH=win44
The Windows command prompt start at "C:\" instead of
"C:\win44". How to fix this problem?

Follow Pegaus' suggestion, fill in the "Start in:"

J
 
Ignore my previous post. I misread your request.

It appears that you want to start in C:\win44. In order to ensure consistent
results do not use environmental variables, which may be only temporary.

Enter C:\win44 in the "Start in" field of the shortcut.
 
Ignore my previous post. I misread your request.

It appears that you want to start in C:\win44. In order to ensure consistent
results do not use environmental variables, which may be only temporary.

Enter C:\win44 in the "Start in" field of the shortcut.

Previously I can set Windows command shell to start C:\win44 by
setting the environment variables "HOMEDRIVE=C:\" and "HOMEPATH=win44"
on windows NT.
I do not know why the same procedure does not work on windows 2000.
 
Previously I can set Windows command shell to start C:\win44 by
setting the environment variables "HOMEDRIVE=C:\" and "HOMEPATH=win44"
on windows NT.
I do not know why the same procedure does not work on windows 2000.

I don't think that you should be trying to change the %homepath%
variable, that may cause problems with other applications, some software
installation packages still use that variable when they are installed.
Instead do as the others have suggested and set the path in your
shortcut properties.

Another thing that you can do is set an "AutoRun" string in the Registry
to change to the desired directory.

When the Command Processor is launched it looks at:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor for instructions,
if it sees an AutoRun value there it will automatically run the string.
If it finds no AutoRun value there it will look for an AutoRun string
in the corresponding HKLM location.

At HKEY_CURRENT_USER\Software\Microsoft\Command Processor if you add the
following:

Value Name: AutoRun
Data Type: REG_SZ

and set the value data to: cd c:\win44

when you launch cmd.exe it will automatically run the command and change
the current directory to C:\win44

If you want to run the Command Processor without executing the AutoRun
commands you can add the /D switch when you start it, CMD /D.

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/91518.mspx?mfr=true

John
 
Previously I can set Windows command shell to start C:\win44 by
setting the environment variables "HOMEDRIVE=C:\" and "HOMEPATH=win44"
on windows NT.
I do not know why the same procedure does not work on windows 2000.

Because you're using the SET command. This will only change it temporarily. You
can see this behavior by opening a command prompt window and enter:

echo %homepath%
(it will display the default value)

set homepath=win44
echo %homepath%
(it should display "win44")

Now exit the window and then open it again and enter:

echo %homepath%
(it will display the default value again)

You can probably override the default by creating a system variable, See this
article for how to:

How To Create System Variables in Windows 2000
http://support.microsoft.com/kb/311843

It would be much simpler if you just enter C:\win44 in the "Start in" field of
the shortcut, as I previously suggested.
 
David Webb said:
Because you're using the SET command. This will only change it
temporarily. You
can see this behavior by opening a command prompt window and enter:

echo %homepath%
(it will display the default value)

set homepath=win44
echo %homepath%
(it should display "win44")

Now exit the window and then open it again and enter:

echo %homepath%
(it will display the default value again)

You can probably override the default by creating a system variable, See
this
article for how to:

How To Create System Variables in Windows 2000
http://support.microsoft.com/kb/311843

It would be much simpler if you just enter C:\win44 in the "Start in"
field of
the shortcut, as I previously suggested.

It appears that the OP has made up his mind to use advanced
techniques such as registry hacks and global environmental
variable editing. I suspect that no amount of reasoning will
convince him to use the simplest of all solutions - to create
a shortcut taylored to his needs.
 
I don't think that you should be trying to change the %homepath%
variable, that may cause problems with other applications, some software
installation packages still use that variable when they are installed.
Instead do as the others have suggested and set the path in your
shortcut properties.

Another thing that you can do is set an "AutoRun" string in the Registry
to change to the desired directory.

When the Command Processor is launched it looks at:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor for instructions,
if it sees an AutoRun value there it will automatically run the string.
If it finds no AutoRun value there it will look for an AutoRun string
in the corresponding HKLM location.

At HKEY_CURRENT_USER\Software\Microsoft\Command Processor if you add the
following:

Value Name: AutoRun
Data Type: REG_SZ

and set the value data to: cd c:\win44

when you launch cmd.exe it will automatically run the command and change
the current directory to C:\win44

If you want to run the Command Processor without executing the AutoRun
commands you can add the /D switch when you start it, CMD /D.

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/r...

John

You are right that I should not be trying to change the %homepath%, so
I revert back to its original value.
I followed your instructions and added the AutoRun string but the
Windows command shell still start at U:\.
Please help.
Thanks.
 
You are right that I should not be trying to change the %homepath%, so
I revert back to its original value.
I followed your instructions and added the AutoRun string but the
Windows command shell still start at U:\.
Please help.
Thanks.

Works for me here, so I'm not sure why it doesn't work for you. The
value data type must be REG_SZ. What did you enter for the value data?
If you start cmd.exe does the same string as what you entered for the
value data work? If it doesn't actually work at the command prompt
don't expect it to work any better if you stick it in the registry, try
or test the command that you want use before you put it in the registry.

John
 
Works for me here, so I'm not sure why it doesn't work for you. The
value data type must be REG_SZ. What did you enter for the value data?
If you start cmd.exe does the same string as what you entered for the
value data work? If it doesn't actually work at the command prompt
don't expect it to work any better if you stick it in the registry, try
or test the command that you want use before you put it in the registry.

John
I entered "cd C:\win44" for the value data.
If I hardcoded "C:\win44" in the "Start in" field of the windows
shell shortcut, then it will start at "C:\win44". There is no need
to change environment variables or registry value.
 
I entered "cd C:\win44" for the value data.
If I hardcoded "C:\win44" in the "Start in" field of the windows
shell shortcut, then it will start at "C:\win44". There is no need
to change environment variables or registry value.

Congratulations! That's what everybody has been telling you for several
days.
 
Back
Top