kukris Posted June 23, 2006 Share Posted June 23, 2006 Hello,how can I create lnk files via script or command?Say I want to create a lnk file which points to C:\Prog\Prog.exe.Normally I have to do it manually by right clicking on Prog.exe and select Create Shortcut.1.) Can this be done by a script or command?2.) Is it possible to use system variables like %systemdrive& instead of fixed paths? Link to comment Share on other sites More sharing options...
egrath Posted June 23, 2006 Share Posted June 23, 2006 Hi Kukris,there is a command called "shortcut.exe" which you can use for this purpose. I have attached the tool.Bye, EgonSHORTCUT.EXE Link to comment Share on other sites More sharing options...
kukris Posted June 23, 2006 Author Share Posted June 23, 2006 Thanks, but I can't it get to work. I checked the help and tried this:shortcut -s -t D:\Progs\Test\test.exe -n Test -d h:\prog-w2k\system -i D:\Progs\Test\test.exe -x 0 -l test.logI put shortcut.exe in c:\temp and execute it from there via a cmd file and get the following error:Error: unable to find D:\Progs\Test\test.lnkAre there maybe some examples or further documentation? Link to comment Share on other sites More sharing options...
egrath Posted June 24, 2006 Share Posted June 24, 2006 Hi,example on how to create a shortcut on the user's desktop:shortcut -f -t C:\SysTools\ProcExp.exe -n "%USERPROFILE%\Desktop\Process Explorer"This will create a shortcut to C:\SysTools\ProcExp and place the corresponding .lnk File on your Desktop.Bye, Egon Link to comment Share on other sites More sharing options...
kukris Posted June 24, 2006 Author Share Posted June 24, 2006 Yeah thanks, that works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now