zoukankan      html  css  js  c++  java
  • 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"        ; 快捷方式创建位置(此处为桌面),注意双引号和后缀名。
  • 相关阅读:
    C++ for循环遍历几种写法
    Windwos查看本地局域网内所有的ip方法
    c define
    ssh
    Linux的iptables菜鸟初学
    nc命令的用法
    电脑莫名重启,VS代码丢失的解决办法
    string判断是否是正常的ip格式
    机器学习之推荐算法
    Springboot将mybatis替换为mybatis-plus
  • 原文地址:https://www.cnblogs.com/top5/p/2134569.html
Copyright © 2011-2022 走看看