SEARCH

The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Windows 7

cmd prompt

(5 posts)
  • Started 5 years ago by Tom
  • Latest reply from Tom
  • Topic Viewed 3465 times

Tom
Posts: 138

In the past when I did the command prompt It gave me C:\Users\myname> And when I did it with "run as administrator" I got C:\Windows\system32> When I upgraded to Win 7 I Don't get the Windows\System32 anymore when I run as administrator. Is this normal or do I have a problem?
Thanks for any help.

Posted 5 years ago
Top
 
ispalten
Posts: 6259

I don't think it is a problem, but under W7 I do open in Windows\System32 vs. user\username when not run as Administrator. I looked at the properties and it shows %HOMEDRIVE%%HOMEPATH% to start in.

Issuing a SET command shows HOMEDRIVE and HOMEPATH is set the same in both instances of the CMD prompt. If you compare the SET's, you'll see that one the Administrator one 'SESSIONNAME=Console' is added. Maybe the code senses this and opens in a different path. In any event, the paths are the same and any command issue in either one would work the same.

Irv S.

Posted 5 years ago
Top
 
Tom
Posts: 138

Thanks for the reply but I don't see HOMEDRIVE and HOMEPATH anywhere. Maybe I just don't understand what you are saying. If this is when you issue the set command after you do the command prompt, I see the SESSIONNAME=Console
but not the other ones.

Posted 5 years ago
Top
 
ispalten
Posts: 6259

Here is my SET output from a 'normal' CMD prompt :

++++++++++++++++++++++++++
C:\Users\Irv>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Irv\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=IRV-XPS435
ComSpec=C:\Windows\system32\cmd.exe
DFSTRACINGON=FALSE
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Irv
LOCALAPPDATA=C:\Users\Irv\AppData\Local
LOGONSERVER=\\IRV-XPS435
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x
86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Rox
io Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLSh
ared\;C:\Windows\System32\Windows System Resource Manager\bin;C:\Windows\System3
2\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a04
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
RoxioCentral=C:\Program Files (x86)\Common Files\Roxio Shared\10.0\Roxio Central
36\
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Irv\AppData\Local\Temp
TMP=C:\Users\Irv\AppData\Local\Temp
TRACE_FORMAT_SEARCH_PATH=\\NTREL202.ntdev.corp.microsoft.com\34FB5F65-FFEB-4B61-
BF0E-A6A76C450FAA\TraceFormat
USERDOMAIN=IRV-XPS435
USERNAME=Irv
USERPROFILE=C:\Users\Irv
windir=C:\Windows

C:\Users\Irv>
+++++++++++++++++++++++++++

Now run as Administrator :

=++++++++++++++++++++++++++

C:\Windows\system32>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Irv\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=IRV-XPS435
ComSpec=C:\Windows\system32\cmd.exe
DFSTRACINGON=FALSE
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Irv
LOCALAPPDATA=C:\Users\Irv\AppData\Local
LOGONSERVER=\\IRV-XPS435
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x
86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Rox
io Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLSh
ared\;C:\Windows\System32\Windows System Resource Manager\bin;C:\Windows\System3
2\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a04
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
RoxioCentral=C:\Program Files (x86)\Common Files\Roxio Shared\10.0\Roxio Central
36\
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Irv\AppData\Local\Temp
TMP=C:\Users\Irv\AppData\Local\Temp
TRACE_FORMAT_SEARCH_PATH=\\NTREL202.ntdev.corp.microsoft.com\34FB5F65-FFEB-4B61-
BF0E-A6A76C450FAA\TraceFormat
USERDOMAIN=IRV-XPS435
USERNAME=Irv
USERPROFILE=C:\Users\Irv
windir=C:\Windows

C:\Windows\system32>
++++++++++++++++++++

I did have the SessionID wrong though, it is in the Administrator one. Sorry about that. Otherwise they are the same.

Now look at your PROPERTIES for the CMD prompt.

The START IN field on my machine has "%HOMEDRIVE%%HOMEPATH%" in it, which means C:\Users\Irv in my case. Do you have that entry? Even if you do, if you do not have those SET settings they are treated as nulls and you'd start in C:\ by default.

Not sure how this is actually created though?

There should be 2 ways to accomplish what you want. One would be a registry change that determines how to start CMD.EXE,

============
[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]
"AutoRun"="C: && cd \\
============

The other is to insert those SET variables via Control Panel -> System -> Advanced -> Environment Variables, and create HOMEDRIVE and HOMEPATH.

Irv S.

Posted 5 years ago
Top
 
Tom
Posts: 138

Thanks ispalten. I made a mistake when I said I didn't see HOMDRIVE AND HOMEPATH. A dumb mistake. Scroll bar not up the whole way. And I do have "%HOMEDRIVE%%HOMEPATH% in the start in field. I guess what you said that it really doesn't matter that a command in either directory will do the same thing answers my question or at least makes it mute.

Posted 5 years ago
Top
 



Topic Closed

This topic has been closed to new replies.