|
本帖最后由 comzhongwy 于 2017-12-16 21:57 编辑
- @ECHO OFF
- ::调用
- call :CreateShort "%USERPROFILE%\desktop\notepad.lnk" ^
- "C:\Windows\notepad.exe" "C:\Users\desktop.ini" ^
- "%USERPROFILE%\desktop" ^
- "Ctrl+Shift+A" "1" "记事本"
- goto :EOF
- :CreateShort
- set "vbs=set a=CreateObject(""WScript.Shell"") :set b=a.CreateShortcut(""%~1"")"
- set "vbs=%vbs% :b.TargetPath=""%~2"" :b.Arguments=""%~3"" :b.WorkingDirectory=""%~4"""
- set "vbs=%vbs% :b.Hotkey=""%~5"" :b.WindowStyle=""%~6"" :b.Description=""%~7"" :b.Save:close"
- start /wait /min mshta VBScript:Execute("%vbs%")
- set "PathLnk=" &set "Lnk=" &set "Target=" &set "Arguments="
- set "WorkingDir=" &set "Hotkey=" &set "WindowStyle=" &set "Description="
- goto :EOF
复制代码
::LnkPath 快捷方式位置
::LnkFile 快捷方式名
::TargetPath 目标
::Arguments 参数
::WorkingDirectory 起始位置
::Hotkey 快捷键
::WindowStyle 窗口启动状态
::Description 快捷方式备注
::IconLocation 快捷方式图标,不设则使用默认图标 |
|