This can be completed relatively easily using the Shell Folders Location of the registry..
It is in the same location no matter if it is 9x, NT, 2k, XP for the current user.
Code:
$desktop = READVALUE("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")
copy "Yourshortcut.LNK" $desktop
If you want to copy it to the "common desktop" for all users under an NT-Based Platform (NT4,W2k,XP).
Code:
$desktop = READVALUE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Desktop")
copy "Yourshortcut.LNK" $desktop
If you want to create shortcuts using WSH, have a look at this UDF - WshShortCut - Create shortcuts programatically with WSH . The difference is that an Application shortcut vs. a Browser Shortcut is that they are a .LNK and .URL, respectively.
Other Locations of interest are (Personal):
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
- Desktop
- Programs
- Start Menu
- Startup
- Personal
These registry locations may not exist on Windows 9x. Other Locations of interest are (All users):
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
- Common Desktop
- Common Documents
- Common Programs
- Common Start Menu
- Common Startup
- Personal
Shortcuts to network shares, exes, etc. are of a .LNK extension and Internet Shortcuts are of a .URL extension.
The following can also be used as part of this process - SoftLink() - Creates a shortcut anywhere