How would you go about creating a heap of shortcuts to a batch file?

G

googleboy

I need to create about 2000 shortcuts to a batch file. The shortcuts
need to have:

Name: %parameter%.lnk

Target: n:\Path\To\batchfile.bat %parameter%
Start In: n:\Path\To\


Where the parameter is filled in by reading in a file with all the
shortcut names.


Extra bonus points for being able to apply the icon for an application
at n:\path\to\application\app.exe

At the moment I am looking like having to do this with VB, but I am
trying hard to leave that behind for evermore.

TIA

googleboy
 
T

Tim Golden

googleboy said:
I need to create about 2000 shortcuts to a batch file.
The shortcuts need to have ...

You need to use the win32com.shell module from pywin32 extensions.
If you search the archives of this group and/or the python-win32
mailing list, you should find several explanations. The best search
term is probably IID_IShellLink.

I've got a Mickey-Mouse module which wraps it and other things here:

http://timgolden.me.uk/python/winshell.html

TJG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top