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"        ; 快捷方式创建位置(此处为桌面),注意双引号和后缀名。
  • 相关阅读:
    设计模式-14-桥接模式
    设计模式-13-中介者模式
    设计模式-12-命令模式
    设计模式-11-外观模式
    设计模式-10-装饰器
    设计模式-9-模板
    设计模式-8-适配器模式-组合
    设计模式-8-适配器模式-继承
    设计模式-7-策略模式+工厂模式
    设计模式-7-策略模式
  • 原文地址:https://www.cnblogs.com/top5/p/2134569.html
Copyright © 2011-2022 走看看