|
|
发表于 2026-2-27 16:27:04
|
显示全部楼层
@echo off
title 批处理创建桌面快捷方式示例
cd /d %~dp0
set "LN1=记事本"
set "CS1=a.SpecialFolders(""Desktop"") & ""\%LN1%.lnk"""
set "TP1=""%%windir%%\system32\notepad.exe"""
set "AP1="""""
set "WD1=""%%HOMEDRIVE%%%%HOMEPATH%%"""
set "HK1=""Ctrl+Shift+N"""
set "IL1=""%%windir%%\system32\notepad.exe"""
set "DN1=""使用基本文本格式创建和编辑文本文件。"""
set "LN2=计算器"
set "CS2=a.SpecialFolders(""Desktop"") & ""\%LN2%.lnk"""
set "TP2=""%%windir%%\system32\calc.exe"""
set "AP2="""""
set "WD2=""%%HOMEDRIVE%%%%HOMEPATH%%"""
set "HK2=""Ctrl+Shift+C"""
set "IL2=""%%windir%%\system32\calc.exe"""
set "DN2=""使用屏幕“计算器”执行基本的算术任务。"""
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(%CS1%):b.TargetPath=%TP1%:b.Arguments=%AP1%:b.WorkingDirectory=%WD1%:b.Hotkey=%HK1%:b.IconLocation=%IL1%:b.Description=%DN1%:b.Save:Close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(%CS2%):b.TargetPath=%TP2%:b.Arguments=%AP2%:b.WorkingDirectory=%WD2%:b.Hotkey=%HK2%:b.IconLocation=%IL2%:b.Description=%DN2%:b.Save:Close") |
|