diff --git a/README.md b/README.md index 26a7ff6b..2196b46f 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Additionally, some npm modules may not be supported in the version of node you'r ### Antivirus -Users have reported some problems using antivirus, specifically McAffee. It appears the antivirus software is manipulating access to the VBScript engine. See [issue #133](https://github.com/coreybutler/nvm-windows/issues/133) for details and resolution. +Users have reported some problems using antivirus, specifically McAfee. It appears the antivirus software is manipulating access to the VBScript engine. See [issue #133](https://github.com/coreybutler/nvm-windows/issues/133) for details and resolution. ### Using Yarn diff --git a/bin/install.cmd b/bin/install.cmd index e5183a78..38cf11c7 100644 --- a/bin/install.cmd +++ b/bin/install.cmd @@ -1,8 +1,13 @@ @echo off set /P NVM_PATH="Enter the absolute path where the zip file is extracted/copied to: " -setx /M NVM_HOME "%NVM_PATH%" -setx /M NVM_SYMLINK "C:\Program Files\nodejs" -setx /M PATH "%PATH%;%NVM_HOME%;%NVM_SYMLINK%" +set NVM_HOME=%NVM_PATH% +set NVM_SYMLINK=C:\Program Files\nodejs +setx /M NVM_HOME "%NVM_HOME%" +setx /M NVM_SYMLINK "%NVM_SYMLINK%" + +for /f "skip=2 tokens=2,*" %%A in ('reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" /v Path 2^>nul') do ( + setx /M PATH "%%B;%%NVM_HOME%%;%%NVM_SYMLINK%%" +) if exist "%SYSTEMDRIVE%\Program Files (x86)\" ( set SYS_ARCH=64