BAT 批处理创建桌面快捷方式代码大全

【一】 直接生成:
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"        ; 快捷方式创建位置(此处为桌面),注意双引号和后缀名。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

forestsea

你的打赏是我精心创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值