【一】 直接生成:
echo [InternetShortcut]>>"%USERPROFILE%\桌面\BatMPlayer.url"
echo URL="C:\BatMPlayer\BatMPlayer.bat">>"%USERPROFILE%\桌面\BatMPlayer.url"
echo IconIndex=99>>"%USERPROFILE%\桌面\BatMPlayer.url"
echo IconFile=%SystemRoot%\system32\SHELL32.dll>>"%USERPROFILE%\桌面\BatMPlayer.url"
【二】 先設(shè)置變量生成:
@echo off
set "path=C:\BatMPlayer\BatMPlayer.bat"
set "name=我的BatMPlayer"
set m="%USERPROFILE%\桌面\%name%.url"
echo [InternetShortcut] >>%m%
echo URL="%path%" >>%m%
echo IconIndex=10 >>%m%
echo IconFile=C:\windows\system32\shell32.dll >>%m%
pause
【三】 簡單生成:
@echo off
md "%userprofile%\桌面\1"
(echo [.shellclassinfo]
echo iconfile="%%systemroot%%\system32\shell32.dll"
echo iconindex=-50
)>"%userprofile%\桌面\1\desktop.ini"
attrib +S +R "%userprofile%\桌面\1"
pause
代碼解釋:
[InternetShortcut] ;快捷方式。
URL="C:\BatMPlayer\BatMPlayer.bat" ;快捷方式的程序路徑。
IconIndex=99 ;快捷方式使用的圖標(biāo)的順序號(此處為系統(tǒng)文件中的圖標(biāo)的順序,位于以下的IconFile文件夾中,具體查看第三部分的《Shell32.Dll 圖標(biāo)資源對照表》)。
IconFile=%SystemRoot%\system32\SHELL32.dll ;快捷方式圖標(biāo)的位置(此處為系統(tǒng)文件路徑,常見系統(tǒng)快捷方式的圖標(biāo)存放位置)。
"%USERPROFILE%\桌面\BatMPlayer.url" ; 快捷方式創(chuàng)建位置(此處為桌面),注意雙引號和后綴名
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報。