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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top