Link to home
Start Free TrialLog in
Avatar of mpenner
mpenner

asked on

Creating a shortcut from code

Is there any way to create a shortcut (.lnk file) from an API call?  Or is there an executable that can be called from a batch file to create a .lnk file?  Thanks.

ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of duneram
duneram

Here is one way...

RunDLL32 AppWiz.Cpl,NewLinkHere c:\Temp
There is also a tool in the nt resource kit called shortcut.
SHORTCUT is a command-line tool for creating and maintaining Windows NT and Windows 95 shortcuts.
For SHORTCUT usage, at the command prompt type shortcut.exe -?


Avatar of mpenner

ASKER

Thanks Madshi, that generally worked.  

AlanB, Sorry don't have the nt resource kit.

Duneram, unfortunately, I can't have user interaction and your method requires that.  Thanks anyway.