CMD命令添加文件快捷方式
命令添加快捷方式
实例一(使用.bat 批处理程序) ---------------------------------------------------------- echo [InternetShortcut] >>test.url echo URL=c:\windows\ >>test.url echo IconIndex=29 >>test.url echo IconFile=C:\windows\system32\shell32.dll >>test.url 实例二(使用.bat 批处理程序) ---------------------------------------------------------- 快捷指令url代码大全@echo off if exist "%test.url" echo 链接 "%test.url" 已创建! & goto :eof if exist "%~f2" echo 目标 "%~f2" 不存在! & goto :eof echo [InternetShortcut] > "%test.url" echo URL=%~f2 >> "%test.url" echo IconIndex=0 >> "%test.url" echo IconFile=%~f2 >> "%test.url" 实例三(使用.vbs 程序) ---------------------------------------------------------- Dim WSHShell, fs Set WSHShell = WScript.CreateObject("WScript.Shell") Set fs = WScript.CreateObject("Scripting.FileSystemObject") Function MakeDesktopShortcut( name, target ) Dim Shortcut,DesktopPath,StartupPath DesktopPath = WSHShell.SpecialFolders("Desktop") Set Shortcut = WSHShell.CreateShortcut(DesktopPath & "\" & name & ".lnk") Shortcut.TargetPath = target StartupPath = fs.GetParentFolderName( target ) If fs.FolderExists( StartupPath ) then Shortcut.WorkingDirectory = StartupPath End If Shortcut.Save End Function MakeDesktopShortcut "Shortcut to Notepad", "C:\" 实例四(使用.vbs 程序) ---------------------------------------------------------- set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录 set oShellLink = WshShell.CreateShortcut(strDesktop & "\qq.lnk") '快捷方式存放目录及名称 oShellLink.TargetPath = "C:\Program Files\Tencent\" '指向的可执行文件 oShellLink.WindowStyle = 1 '运行方式 oShellLink.Hotkey = "CTRL+SHIFT+F" '快捷键 oShellLink.IconLocation = "C:\Program Files\Tencent\, 0" '图标 oShellLink.Description = "qq" '备注 oShellLink.WorkingDirectory = "C:\Program Files\Tencent\QQ\" '起始目录 oShellLink.Save '创建快捷方式 |
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论