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

Discussion in 'Python' started by googleboy, Sep 17, 2006.

  1. googleboy

    googleboy Guest

    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
    googleboy, Sep 17, 2006
    #1
    1. Advertising

  2. googleboy

    Tim Golden Guest

    googleboy wrote:
    > 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
    Tim Golden, Sep 17, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Townsend

    Creating internet shortcuts

    Richard Townsend, Oct 9, 2005, in forum: Python
    Replies:
    2
    Views:
    325
    Richard Townsend
    Oct 10, 2005
  2. Ron Griswold

    Creating shortcuts?

    Ron Griswold, Jan 13, 2006, in forum: Python
    Replies:
    2
    Views:
    358
    Roger Upole
    Jan 13, 2006
  3. Ron Griswold

    RE: Creating shortcuts?

    Ron Griswold, Jan 13, 2006, in forum: Python
    Replies:
    1
    Views:
    511
    Paul Watson
    Jan 13, 2006
  4. Michal Slocinski

    Heap dump file size vs heap size

    Michal Slocinski, Mar 25, 2008, in forum: Java
    Replies:
    1
    Views:
    733
    GArlington
    Mar 25, 2008
  5. viki
    Replies:
    6
    Views:
    561
    Erik Wikström
    Jun 28, 2008
Loading...

Share This Page