Chr*_*ris 3 windows powershell environment-variables
让我们说这是我的Windows系统PATH的样子:
C:\ ORACLE \产品\ 11.2.0\32位\的Client_1\BIN; C:\ ORACLE \产品\ 11.2.0\64 \的Client_1\BIN; C:\窗口\ system32; C:\ WINDOWS; C:\ WINDOWS\System32下\ WBEM; C:\ Windows\System32下\ WindowsPowerShell\V1.0 \
如何删除第一个条目并将其添加到列表末尾?我知道你可以使用setx,但我宁愿使用PowerShell来做这件事.
# Split the existing path into the 1st entry and the rest.
$first, $rest = $env:Path -split ';'
# Rebuild the path with the first entry appended.
$env:Path = ($rest + $first) -join ';'
# To make this change persistent for the current user,
# an extra step is needed:
[Environment]::SetEnvironmentVariable('Path', $env:Path, 'User')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
616 次 |
| 最近记录: |