internet快捷方式是文本格式的,可以参考一下。
───────────────── 版主提示 ─────────────────
关于这个方案的实现有以下实例,具体请参考,
实例1:
echo >>a.url
echo URL=c:\windows\system32\notepad.exe >>a.url
echo IconIndex=29 >>a.url
echo IconFile=C:\windows\system32\shell32.dll >>a.url
实例2:
@echo off
if exist "%1.url" echo 链接 "%1.url" 已创建! & goto :eof
if exist "%~f2" echo 目标 "%~f2" 不存在! & goto :eof
echo > "%1.URL"
echo URL=%~f2 >> "%1.URL"
echo IconIndex=0 >> "%1.URL"
echo IconFile=%~f2 >> "%1.URL"
如何用批处理创建一个快捷方式?
http://www.cn-dos.net/forum/viewthread.php?tid=20183
───────────────── 版主提示 ─────────────────
Last edited by willsort on 2006-5-11 at 17:46 ]
Windows XP里没有命令是专么干这件事的。可以借助其他工具。
1. Windows 95或Nt 4.0 Resource Kit里都有一个叫shortcut.exe的命令。(推荐)
2. 第三方
Shortcut.exe
3. 使用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:\Windows\Notepad.exe"
--------------------------------------------------------------------------------------------
可以参考
这个贴子,或者参考楼上的vbs方法,给个注释:
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录
set oShellLink = WshShell.CreateShortcut(strDesktop & "\qq.lnk") '快捷方式存放目录及名称
oShellLink.TargetPath = "C:\Program Files\Tencent\QQ\CoralQQ.exe" '指向的可执行文件
oShellLink.WindowStyle = 1 '运行方式
oShellLink.Hotkey = "CTRL+SHIFT+F" '快捷键
oShellLink.IconLocation = "C:\Program Files\Tencent\QQ\QQ.exe, 0" '图标
oShellLink.Description = "qq" '备注
oShellLink.WorkingDirectory = "C:\Program Files\Tencent\QQ\" '起始目录
oShellLink.Save '创建快捷方式
在XP下可以试试这个:
fsutil file createnew C:\test 0
rundll32.exe appwiz.cpl,NewLinkHere C:\test
系统会提示在C:\下建立一个快捷方式
Last edited by electronixtar on 2006-5-10 at 22:32 ]