본문 바로가기
IT-개발,DB

[개발] 시스템 특수 폴더에 도움이 되는 자료

by SB리치퍼슨 2010. 8. 30.



32bit / 64bit processor 에 대한 시스템 특수폴더를 이해하고 사용하는데 도움이 될 만한 내용입니다.

 참고로 관련 정보가 레지스트리에도 있습니다.

경로는  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
 

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.

반응형

댓글