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"
--------------------------------------------------------------------------------------------
There is no command in Windows XP specifically for doing this. You can use other tools.
1. There is a command called shortcut.exe in Windows 95 or Nt 4.0 Resource Kit. (Recommended)
2. Third - party
Shortcut.exe
3. Use 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"
--------------------------------------------------------------------------------------------