Windows path user variable 방법

If the PATH, ORACLE_SID, and ORACLE_HOME environment variables do not exist, you must create them.

Assign the values specified in Figure 7-2. On Windows systems, you must be an administrator to create or modify environment variables.

To create or modify environment variables on Windows 10:

    1. On the Windows taskbar, right-click the Windows icon and select System.

    2. In the Settings window, under Related Settings, click Advanced system settings.

    3. On the Advanced tab, click Environment Variables.

    4. Click New to create a new environment variable. Click Edit to modify an existing environment variable.

    5. After creating or modifying the environment variable, click Apply and then OK to have the change take effect.

Note:

The graphical user interface for creating environment variables may vary slightly, depending on your version of Windows.

This should be able to be done by setting the "Path" when your computer starts up. So you're using Win 7... Just wondering why you're using the command line to launch these?? There are much easier and quicker ways....

The path is now managed by Windows 7 and not the autoexec.bat or autoexec.nt files. To change the system environment variables, follow the below steps.

1.From the desktop, right-click My Computer and click Properties.

2.In the System Properties window, click on the Advanced tab.

3.In the Advanced section, click the Environment Variables button.

4.Finally, in the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon.

Hope this helps

setx name1 val1

//-------------------------------------
    - 바뀐 환경 변수 현재 터미널 창에 바로 적용하기

    - Chocolatey (윈도우 패키지 매니저)설치

> @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('//community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

    - 환경변수 새로고침 명령
refreshenv

    - 확인
> set name1

//-----------------------------------------------------------------------------

//-------------------------------------
PATH 에 대해서 사용시 위험, 사용하면 안됨
    - User 변수와 System 변수가 합쳐짐

    - PATH_HKCU : User 변수
    - PATH_HKLM : System 변수

//-------------------------------------
- setx로 변수 제거는 안됨, 제거를 위해서는 reg 명령으로 레지스트리 수정

//-----------------------------------------------------------------------------
//-------------------------------------
    - 윈도우 환경 변수의 레지스트리 저장 경로

    - User 환경변수 경로
"HKEY_CURRENT_USER\Environment"

    - System 환경변수 경로
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

//-------------------------------------
레지스트리 수정 명령어 참고
//codens.info/2370

//-------------------------
    - 환경 변수 제거
> reg delete "HKCU\Environment" /v "name1"  /f

//-------------------------------------
    - PATH 에서 특정 경로 삭제 (PATH_HKCU이용)

       

- PATH변수를 바로 사용하면 안됨 (사용자 변수와 시스템 변수가 합쳐짐)
> set PATH_HKCU=%PATH_HKCU:삭제할 경로;=%
> reg add "HKCU\Environment" /v "Path" /t REG_EXPAND_SZ /d "%PATH_HKCU%" /f

    - PATH 추가  (PATH_HKCU이용)
> set PATH_HKCU=%PATH_HKCU%;추가할 경로
> reg add "HKCU\Environment" /v "Path" /t REG_EXPAND_SZ /d "%PATH_HKCU%" /f

//-----------------------------------------------------------------------------
// 참고

    - set은 재부팅시 적용 안됨
> set name1=val1

Toplist

최신 우편물

태그