設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 578|回復: 0
打印 上一主題 下一主題

Update Windows Path Without Rebooting

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2017-11-6 08:58:30 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
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

  1. @echo off
  2. taskkill /f /im explorer.exe
  3. 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
  1. @echo off   
  2. color 0B   
  3. echo JumpStart! v0.1 by Scotch   
  4. echo.   
  5. echo Your desktop is being restored, Please wait. . .   
  6. ping -n 5 127.0.0.1 > NUL 2>&1   
  7. echo Killing process Explorer.exe. . .   
  8. taskkill /f /im explorer.exe   
  9. cls   
  10. echo Success!   
  11. echo.   
  12. echo Your desktop is now loading. . .   
  13. ping -n 5 127.0.0.1 > NUL 2>&1   
  14. echo.   
  15. ping -n 5 127.0.0.1 > NUL 2>&1   
  16. start explorer.exe   
  17. exit
複製代碼
his file with .bat extension is the batch file that needs to be dragged to the 'Startup' from 'All Programs'.


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-6-1 12:36 , Processed in 0.232219 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表