【一】 直接生成:
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"
 
【二】 先设置变量生成:
 @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         ;快捷方式使用的图标的顺序号(此处为系统文件中的图标的顺序,位于以下的IconFile文件夹中,具体查看第三部分的《Shell32.Dll 图标资源对照表》)。
IconFile=%SystemRoot%\system32\SHELL32.dll         ;快捷方式图标的位置(此处为系统文件路径,常见系统快捷方式的图标存放位置)。
"%USERPROFILE%\桌面\BatMPlayer.url"        ; 快捷方式创建位置(此处为桌面),注意双引号和后缀名。

相关文章:

  • 2021-08-01
  • 2021-09-13
  • 2022-02-25
  • 2022-01-26
  • 2021-11-18
  • 2021-06-20
  • 2022-02-27
  • 2021-06-29
猜你喜欢
  • 2021-12-27
  • 2022-03-01
  • 2022-12-23
  • 2021-11-19
  • 2021-07-27
  • 2021-05-02
  • 2021-10-25
相关资源
相似解决方案