bat添加环境变量
文章目录[隐藏]
bat 添加环境变量代码
::添加环境变量Oracle
@echo off
echo 添加 Oracle环境变量
set "regPath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
set "eventName=Oracle 名称"
set "eventPath=c:\Oracle 路径"
reg add "%regPath%" /v %eventName% /d %eventPath% /f
pause
::删除环境变量Oracle
@echo off
echo 删除 Oracle环境变量
set "regPath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
set "eventName=Oracle 名称"
reg delete "%regPath%" /v "%eventName%" /f
pause