批處理里不能使用變量路徑最后由 winsfly 于 -7-17 20:48我最近做了一個批處理,功能就是在桌面上創建一個指定鏈接的URL關鍵就是我想智能判斷桌面在哪并在桌面上創建代碼:rem 創建桌面網址導航if exist desktop.txt del desktop.txt reg query HKCUsoftwaremicrosoftwindowscurrentversionexplorerUser Shell Folders /v Desktop >desktop.txtfor /f skip=4 tokens=3 %%a in (desktop.txt) do cd /d %%adel desktop.txtif exist 網址導航.url del 網址導航.urlecho [DEFAULT]>>網址導航.urlecho baseURL=http://www.jj123.com.cn/index.htm?u=4756>>網址導航.urlecho [InternetShortcut]>>網址導航.urlecho URL=http://www.jj123.com.cn/index.htm?u=4756>>網址導航.urlecho IconIndex=41>>網址導航.urlecho IconFile=C:WINDOWSsystem32shell32.dll>>網址導航.url我當前的桌面在注冊表中是%userprofile%桌面我在cmd窗口可以 cd /d %userprofile%桌面在批處理里面就不行,發現是因為有個%userprofile%變量另外求教有沒有會做lnk的Internet Explorer快捷方式并指定鏈接為某個網址?