Set/Unset user environment as origional non-admin user

This commit is contained in:
Noel Hibbard
2019-07-07 18:05:03 -04:00
parent 0c58b2eed8
commit 6cf92c69c0
3 changed files with 25 additions and 39 deletions

11
bin/setuserenv.vbs Normal file
View 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
View 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