mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2025-09-03 19:28:21 +00:00
Set/Unset user environment as origional non-admin user
This commit is contained in:
11
bin/setuserenv.vbs
Normal file
11
bin/setuserenv.vbs
Normal file
@@ -0,0 +1,11 @@
|
||||
Set WSHShell = CreateObject("WScript.Shell")
|
||||
userpath = WSHShell.RegRead("HKCU\Environment\Path")
|
||||
If InStr(userpath, "%NVM_HOME%") = False Then
|
||||
userpath = userpath & ";%NVM_HOME%;"
|
||||
End If
|
||||
If InStr(userpath, "%NVM_SYMLINK%") = False Then
|
||||
userpath = userpath & ";%NVM_SYMLNK%;"
|
||||
End If
|
||||
|
||||
userpath = Replace(userpath, ";;", ";")
|
||||
WSHShell.RegWrite "HKCU\Environment\Path", userpath
|
6
bin/unsetuserenv.vbs
Normal file
6
bin/unsetuserenv.vbs
Normal file
@@ -0,0 +1,6 @@
|
||||
Set WSHShell = CreateObject("WScript.Shell")
|
||||
userpath = WSHShell.RegRead("HKCU\Environment\Path")
|
||||
userpath = Replace(userpath, "%NVM_HOME%", "")
|
||||
userpath = Replace(userpath, "%NVM_SYMLINK%", "")
|
||||
userpath = Replace(userpath, ";;", ";")
|
||||
WSHShell.RegWrite "HKCU\Environment\Path", userpath
|
Reference in New Issue
Block a user