if you Update Windows Path variables and click ok. they donot show up but if you end explorer.exe task and run a new explorer.exe task up it will now refresh with the new path variable.
Simply restart explorer.exe in Task Manager
OR
- @echo off
- taskkill /f /im explorer.exe
- start explorer.exe
複製代碼If the environment variable is set by another application and is not being updated, it is often easiest to either restart the "explorer.exe" process, log out and back in, or reboot. Essentially, you just need to tell explorer to reload the environment variables. If it is an application that you have developed, such as an installer, ensure that it is calling SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment");. This tells explorer to refresh its cache of the environment variables.
Batch script to automatically reload explorer.exe - @echo off
- color 0B
- echo JumpStart! v0.1 by Scotch
- echo.
- echo Your desktop is being restored, Please wait. . .
- ping -n 5 127.0.0.1 > NUL 2>&1
- echo Killing process Explorer.exe. . .
- taskkill /f /im explorer.exe
- cls
- echo Success!
- echo.
- echo Your desktop is now loading. . .
- ping -n 5 127.0.0.1 > NUL 2>&1
- echo.
- ping -n 5 127.0.0.1 > NUL 2>&1
- start explorer.exe
- exit
複製代碼 his file with .bat extension is the batch file that needs to be dragged to the 'Startup' from 'All Programs'.
|