Problem creating a shorcut

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Driscoll

    Problem creating a shorcut

    Hi,

    I've had this niggling issue from time to time. I want to create a
    shortcut on the user's desktop to a website that specifically loads
    Firefox even if Firefox is not the default browser.

    I usually use COM as it allows very specific settings of the shortcut,
    such as the Working Directory and the Target Path. However, the
    following will not work for some reason:

    <code>

    import win32com.client
    import winshell

    shell = win32com.client .Dispatch('WScr ipt.Shell')
    userDesktop = winshell.deskto p()

    shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
    shortcut.Target path = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
    https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
    shortcut.Workin gDirectory = r'C:\Program Files\Mozilla
    Firefox'
    shortcut.save()

    </code>

    This creates the following target path (which doesn't work):

    "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
    \www.myCompanyW ebsite.com\auth \preauth.php"

    If I leave the website off, it works. If I leave the path to Firefox
    out, it works too. Is there another method I can use other than
    creating the shortcut by hand and using the shutil module?

    Thank you for any ideas.

    Mike
  • Larry Bates

    #2
    Re: Problem creating a shorcut

    Mike Driscoll wrote:
    Hi,
    >
    I've had this niggling issue from time to time. I want to create a
    shortcut on the user's desktop to a website that specifically loads
    Firefox even if Firefox is not the default browser.
    >
    I usually use COM as it allows very specific settings of the shortcut,
    such as the Working Directory and the Target Path. However, the
    following will not work for some reason:
    >
    <code>
    >
    import win32com.client
    import winshell
    >
    shell = win32com.client .Dispatch('WScr ipt.Shell')
    userDesktop = winshell.deskto p()
    >
    shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
    shortcut.Target path = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
    https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
    shortcut.Workin gDirectory = r'C:\Program Files\Mozilla
    Firefox'
    shortcut.save()
    >
    </code>
    >
    This creates the following target path (which doesn't work):
    >
    "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
    \www.myCompanyW ebsite.com\auth \preauth.php"
    >
    If I leave the website off, it works. If I leave the path to Firefox
    out, it works too. Is there another method I can use other than
    creating the shortcut by hand and using the shutil module?
    >
    Thank you for any ideas.
    >
    Mike
    Either you copied wrong or the problem is:

    "C:\"C:\Pro gram Files...


    Note the C:\ is specified twice in the string. I think it should read:
    "C:\Program Files\Mozilla Firefox\firefox .exe" https:
    \www.myCompanyW ebsite.com\auth \preauth.php"
    -Larry

    Comment

    • Mike Driscoll

      #3
      Re: Problem creating a shorcut

      On May 15, 2:03 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
      Mike Driscoll wrote:
      Hi,
      >
      I've had this niggling issue from time to time. I want to create a
      shortcut on the user's desktop to a website that specifically loads
      Firefox even if Firefox is not the default browser.
      >
      I usually use COM as it allows very specific settings of the shortcut,
      such as the Working Directory and the Target Path. However, the
      following will not work for some reason:
      >
      <code>
      >
      import win32com.client
      import winshell
      >
      shell = win32com.client .Dispatch('WScr ipt.Shell')
      userDesktop = winshell.deskto p()
      >
      shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
      shortcut.Target path = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
      https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
      shortcut.Workin gDirectory = r'C:\Program Files\Mozilla
      Firefox'
      shortcut.save()
      >
      </code>
      >
      This creates the following target path (which doesn't work):
      >
      "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
      \www.myCompanyW ebsite.com\auth \preauth.php"
      >
      If I leave the website off, it works. If I leave the path to Firefox
      out, it works too. Is there another method I can use other than
      creating the shortcut by hand and using the shutil module?
      >
      Thank you for any ideas.
      >
      Mike
      >
      Either you copied wrong or the problem is:
      >
      "C:\"C:\Pro gram Files...
      >
      Note the C:\ is specified twice in the string. I think it should read:
      >
      "C:\Program Files\Mozilla Firefox\firefox .exe" https:
      \www.myCompanyW ebsite.com\auth \preauth.php"
      >
      -Larry
      Yeah, I know that it's in there twice and that that is the problem.
      But I'm not causing that extra C:\. I run it exactly as above and that
      is what I get for the output. I think it's the COM object. Maybe I
      better just re-post this to the PyWin32 list...

      Thanks,

      Mike

      Comment

      • Gabriel Genellina

        #4
        Re: Problem creating a shorcut

        En Thu, 15 May 2008 12:13:56 -0300, Mike Driscoll <kyosohma@gmail .com>
        escribió:
        I've had this niggling issue from time to time. I want to create a
        shortcut on the user's desktop to a website that specifically loads
        Firefox even if Firefox is not the default browser.
        >
        I usually use COM as it allows very specific settings of the shortcut,
        such as the Working Directory and the Target Path. However, the
        following will not work for some reason:
        Try this different approach, using the IShellLink interface:


        --
        Gabriel Genellina

        Comment

        • Chris

          #5
          Re: Problem creating a shorcut

          On May 15, 5:13 pm, Mike Driscoll <kyoso...@gmail .comwrote:
          Hi,
          >
          I've had this niggling issue from time to time. I want to create a
          shortcut on the user's desktop to a website that specifically loads
          Firefox even if Firefox is not the default browser.
          >
          I usually use COM as it allows very specific settings of the shortcut,
          such as the Working Directory and the Target Path. However, the
          following will not work for some reason:
          >
          <code>
          >
          import win32com.client
          import winshell
          >
          shell = win32com.client .Dispatch('WScr ipt.Shell')
          userDesktop = winshell.deskto p()
          >
          shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
          shortcut.Target path = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
          https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
          shortcut.Workin gDirectory = r'C:\Program Files\Mozilla
          Firefox'
          shortcut.save()
          >
          </code>
          >
          This creates the following target path (which doesn't work):
          >
          "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
          \www.myCompanyW ebsite.com\auth \preauth.php"
          >
          If I leave the website off, it works. If I leave the path to Firefox
          out, it works too. Is there another method I can use other than
          creating the shortcut by hand and using the shutil module?
          >
          Thank you for any ideas.
          >
          Mike
          Don't set arguments in the path.

          shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
          shortcut.Target Path = r'Program Files\Mozilla Firefox\firefox .exe'
          shortcut.Argume nts = r'https:\www.myCompanyWebsite.com\auth
          \preauth.php'
          shortcut.Workin gDirectory = r'C:\Program Files\Mozilla Firefox'
          shortcut.save()

          Comment

          • Wolfgang Draxinger

            #6
            Re: Problem creating a shorcut

            Mike Driscoll wrote:
            Hi,
            >
            I've had this niggling issue from time to time. I want to
            create a shortcut on the user's desktop to a website that
            specifically loads Firefox even if Firefox is not the default
            browser.
            >
            I usually use COM as it allows very specific settings of the
            shortcut, such as the Working Directory and the Target Path.
            However, the following will not work for some reason:
            >
            <code>
            >
            import win32com.client
            import winshell
            >
            shell = win32com.client .Dispatch('WScr ipt.Shell')
            userDesktop = winshell.deskto p()
            >
            shortcut = shell.CreateSho rtCut(userDeskt op +
            '\\MyShortcut.l nk') shortcut.Target path = r'"C:\Program
            Files\Mozilla Firefox\firefox .exe"
            https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
            shortcut.Workin gDirectory = r'C:\Program Files\Mozilla Firefox'
            shortcut.save()
            >
            </code>
            >
            This creates the following target path (which doesn't work):
            >
            "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
            \www.myCompanyW ebsite.com\auth \preauth.php"
            >
            If I leave the website off, it works. If I leave the path to
            Firefox out, it works too. Is there another method I can use
            other than creating the shortcut by hand and using the shutil
            module?
            >
            Thank you for any ideas.
            I see four problems:

            1) you should not hardcode the backslashes ('\'), instead use
            os.sep for it.

            2) In URIs there are no backslashes, only forward slashes. You
            coded

            https:\...

            which is _WRONG_. URIs are <protocoll>://<host>/<resource>, where
            for some protocolls <hostis empty (file protocoll e.g.).

            3) You assume, that Firefox is always installed at C:\Program
            Files\Mozilla Firefox\firefox .exe
            However the path largely differs from system to system. On *nix
            systems you normally have all programs in $PATH, so a non full
            qualified path would be sufficient. On Windows this works, too,
            _IF_ the installation directory of the to be used application
            get's added to the PATH environment variable.

            Wolfgang Draxinger
            --
            E-Mail address works, Jabber: hexarith@jabber .org, ICQ: 134682867

            Comment

            • Tim Golden

              #7
              Re: Problem creating a shorcut

              Wolfgang Draxinger wrote:
              1) you should not hardcode the backslashes ('\'), instead use
              os.sep for it.
              With respect, the OP is creating a Windows desktop shortcut.
              Unless Microsoft suddenly decide to change their use of the
              backslash, I suggest that this is a needless generalisation.
              3) You assume, that Firefox is always installed at C:\Program
              Files\Mozilla Firefox\firefox .exe
              However the path largely differs from system to system.
              This is broadly true. However, it's fairly clear from the
              phrase "the user's desktop" that the OP is working in some
              kind of corporate environment where he can be fairly sure
              where Firefox is installed by policy. In addition, it's not so
              easy to find its path if it's not in the default place since apps
              very rarely add their location to the system PATH these days
              (and Firefox certainly doesn't). You could scan the registry for
              its App Paths entry in the registry but I don't know if any other
              way if it's not the default browser (which it's clear from the
              original post it may not be).

              Sorry to sound a bit negative, but I felt that a couple of your points,
              while valid, were not altogether helpful to the situation the OP was in.

              TJG

              Comment

              • Tim Golden

                #8
                Re: Problem creating a shorcut

                Wolfgang Draxinger wrote:
                1) you should not hardcode the backslashes ('\'), instead use
                os.sep for it.
                With respect, the OP is creating a Windows desktop shortcut.
                Unless Microsoft suddenly decide to change their use of the
                backslash, I suggest that this is a needless generalisation.
                3) You assume, that Firefox is always installed at C:\Program
                Files\Mozilla Firefox\firefox .exe
                However the path largely differs from system to system.
                This is broadly true. However, it's fairly clear from the
                phrase "the user's desktop" that the OP is working in some
                kind of corporate environment where he can be fairly sure
                where Firefox is installed by policy. In addition, it's not so
                easy to find its path if it's not in the default place since apps
                very rarely add their location to the system PATH these days
                (and Firefox certainly doesn't). You could scan the registry for
                its App Paths entry in the registry but I don't know if any other
                way if it's not the default browser (which it's clear from the
                original post it may not be).

                Sorry to sound a bit negative, but I felt that a couple of your points,
                while valid, were not altogether helpful to the situation the OP was in.

                TJG

                Comment

                • Larry Bates

                  #9
                  Re: Problem creating a shorcut

                  Mike Driscoll wrote:
                  On May 15, 2:03 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
                  >Mike Driscoll wrote:
                  >>Hi,
                  >>I've had this niggling issue from time to time. I want to create a
                  >>shortcut on the user's desktop to a website that specifically loads
                  >>Firefox even if Firefox is not the default browser.
                  >>I usually use COM as it allows very specific settings of the shortcut,
                  >>such as the Working Directory and the Target Path. However, the
                  >>following will not work for some reason:
                  >><code>
                  >>import win32com.client
                  >>import winshell
                  >>shell = win32com.client .Dispatch('WScr ipt.Shell')
                  >>userDesktop = winshell.deskto p()
                  >>shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
                  >>shortcut.Targ etpath = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
                  >>https:\www.my CompanyWebsite. com\auth\preaut h.php'
                  >>shortcut.Work ingDirectory = r'C:\Program Files\Mozilla
                  >>Firefox'
                  >>shortcut.save ()
                  >></code>
                  >>This creates the following target path (which doesn't work):
                  >>"C:\"C:\Progr am Files\Mozilla Firefox\firefox .exe" https:
                  >>\www.myCompan yWebsite.com\au th\preauth.php"
                  >>If I leave the website off, it works. If I leave the path to Firefox
                  >>out, it works too. Is there another method I can use other than
                  >>creating the shortcut by hand and using the shutil module?
                  >>Thank you for any ideas.
                  >>Mike
                  >Either you copied wrong or the problem is:
                  >>
                  >"C:\"C:\Progra m Files...
                  >>
                  >Note the C:\ is specified twice in the string. I think it should read:
                  >>
                  > "C:\Program Files\Mozilla Firefox\firefox .exe" https:
                  > \www.myCompanyW ebsite.com\auth \preauth.php"
                  >>
                  >-Larry
                  >
                  Yeah, I know that it's in there twice and that that is the problem.
                  But I'm not causing that extra C:\. I run it exactly as above and that
                  is what I get for the output. I think it's the COM object. Maybe I
                  better just re-post this to the PyWin32 list...
                  >
                  Thanks,
                  >
                  Mike
                  I use Inno Setup on most of my applications and use it to create my desktop,
                  quicklaunch and Start shortcuts. Would that be an option for you?

                  -Larry

                  Comment

                  • Mike Driscoll

                    #10
                    Re: Problem creating a shorcut

                    On May 16, 5:44 am, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
                    wrote:
                    Mike Driscoll wrote:
                    Hi,
                    >
                    I've had this niggling issue from time to time. I want to
                    create a shortcut on the user's desktop to a website that
                    specifically loads Firefox even if Firefox is not the default
                    browser.
                    >
                    I usually use COM as it allows very specific settings of the
                    shortcut, such as the Working Directory and the Target Path.
                    However, the following will not work for some reason:
                    >
                    <code>
                    >
                    import win32com.client
                    import winshell
                    >
                    shell = win32com.client .Dispatch('WScr ipt.Shell')
                    userDesktop = winshell.deskto p()
                    >
                    shortcut = shell.CreateSho rtCut(userDeskt op +
                    '\\MyShortcut.l nk') shortcut.Target path = r'"C:\Program
                    Files\Mozilla Firefox\firefox .exe"
                    https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
                    shortcut.Workin gDirectory = r'C:\Program Files\Mozilla Firefox'
                    shortcut.save()
                    >
                    </code>
                    >
                    This creates the following target path (which doesn't work):
                    >
                    "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
                    \www.myCompanyW ebsite.com\auth \preauth.php"
                    >
                    If I leave the website off, it works. If I leave the path to
                    Firefox out, it works too. Is there another method I can use
                    other than creating the shortcut by hand and using the shutil
                    module?
                    >
                    Thank you for any ideas.
                    >
                    I see four problems:
                    >
                    1) you should not hardcode the backslashes ('\'), instead use
                    os.sep for it.
                    >
                    2) In URIs there are no backslashes, only forward slashes. You
                    coded
                    >
                    https:\...
                    >
                    which is _WRONG_. URIs are <protocoll>://<host>/<resource>, where
                    for some protocolls <hostis empty (file protocoll e.g.).

                    That was an accident...my original code was correct, but I stupidly
                    decided to generalize my website's name and put the wrong slashes in.

                    >
                    3) You assume, that Firefox is always installed at C:\Program
                    Files\Mozilla Firefox\firefox .exe
                    However the path largely differs from system to system. On *nix
                    systems you normally have all programs in $PATH, so a non full
                    qualified path would be sufficient. On Windows this works, too,
                    _IF_ the installation directory of the to be used application
                    get's added to the PATH environment variable.
                    >

                    I don't assume it at all. At my place of business, that's where
                    Firefox is. If it's not installed there when the user logs in, one of
                    my scripts installs it automatically.

                    Wolfgang Draxinger
                    --
                    E-Mail address works, Jabber: hexar...@jabber .org, ICQ: 134682867

                    Comment

                    • Mike Driscoll

                      #11
                      Re: Problem creating a shorcut

                      On May 16, 1:51 am, Chris <cwi...@gmail.c omwrote:
                      On May 15, 5:13 pm, Mike Driscoll <kyoso...@gmail .comwrote:
                      >
                      >
                      >
                      Hi,
                      >
                      I've had this niggling issue from time to time. I want to create a
                      shortcut on the user's desktop to a website that specifically loads
                      Firefox even if Firefox is not the default browser.
                      >
                      I usually use COM as it allows very specific settings of the shortcut,
                      such as the Working Directory and the Target Path. However, the
                      following will not work for some reason:
                      >
                      <code>
                      >
                      import win32com.client
                      import winshell
                      >
                      shell = win32com.client .Dispatch('WScr ipt.Shell')
                      userDesktop = winshell.deskto p()
                      >
                      shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
                      shortcut.Target path = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
                      https:\www.myCo mpanyWebsite.co m\auth\preauth. php'
                      shortcut.Workin gDirectory = r'C:\Program Files\Mozilla
                      Firefox'
                      shortcut.save()
                      >
                      </code>
                      >
                      This creates the following target path (which doesn't work):
                      >
                      "C:\"C:\Pro gram Files\Mozilla Firefox\firefox .exe" https:
                      \www.myCompanyW ebsite.com\auth \preauth.php"
                      >
                      If I leave the website off, it works. If I leave the path to Firefox
                      out, it works too. Is there another method I can use other than
                      creating the shortcut by hand and using the shutil module?
                      >
                      Thank you for any ideas.
                      >
                      Mike
                      >
                      Don't set arguments in the path.
                      >
                      shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
                      shortcut.Target Path = r'Program Files\Mozilla Firefox\firefox .exe'
                      shortcut.Argume nts = r'https:\www.myCompanyWebsite.com\auth
                      \preauth.php'
                      shortcut.Workin gDirectory = r'C:\Program Files\Mozilla Firefox'
                      shortcut.save()
                      Ah. I was unaware of the Arguments parameter. That works quite well.
                      Where does one find this information anyway? I think I found mine from
                      bits and pieces scattered in various tutorials.

                      Thanks a lot.

                      Mike

                      Comment

                      • Mike Driscoll

                        #12
                        Re: Problem creating a shorcut

                        On May 15, 8:24 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
                        wrote:
                        En Thu, 15 May 2008 12:13:56 -0300, Mike Driscoll <kyoso...@gmail .com 
                        escribió:
                        >
                        I've had this niggling issue from time to time. I want to create a
                        shortcut on the user's desktop to a website that specifically loads
                        Firefox even if Firefox is not the default browser.
                        >
                        I usually use COM as it allows very specific settings of the shortcut,
                        such as the Working Directory and the Target Path. However, the
                        following will not work for some reason:
                        >
                        Try this different approach, using the IShellLink interface:http://aspn.activestate.com/ASPN/doc...pywin32/win32c...
                        >
                        --
                        Gabriel Genellina
                        Thanks Gabriel...it looks a little overwhelming, but I'll file it away
                        for future reference.

                        Mike

                        Comment

                        • Mike Driscoll

                          #13
                          Re: Problem creating a shorcut

                          On May 16, 8:09 am, Larry Bates <larry.ba...@we bsafe.com`wrote :
                          Mike Driscoll wrote:
                          On May 15, 2:03 pm, Larry Bates <larry.ba...@we bsafe.com`wrote :
                          Mike Driscoll wrote:
                          >Hi,
                          >I've had this niggling issue from time to time. I want to create a
                          >shortcut on the user's desktop to a website that specifically loads
                          >Firefox even if Firefox is not the default browser.
                          >I usually use COM as it allows very specific settings of the shortcut,
                          >such as the Working Directory and the Target Path. However, the
                          >following will not work for some reason:
                          ><code>
                          >import win32com.client
                          >import winshell
                          >shell = win32com.client .Dispatch('WScr ipt.Shell')
                          >userDesktop = winshell.deskto p()
                          >shortcut = shell.CreateSho rtCut(userDeskt op + '\\MyShortcut.l nk')
                          >shortcut.Targe tpath = r'"C:\Program Files\Mozilla Firefox\firefox .exe"
                          >https:\www.myC ompanyWebsite.c om\auth\preauth .php'
                          >shortcut.Worki ngDirectory = r'C:\Program Files\Mozilla
                          >Firefox'
                          >shortcut.save( )
                          ></code>
                          >This creates the following target path (which doesn't work):
                          >"C:\"C:\Progra m Files\Mozilla Firefox\firefox .exe" https:
                          >\www.myCompany Website.com\aut h\preauth.php"
                          >If I leave the website off, it works. If I leave the path to Firefox
                          >out, it works too. Is there another method I can use other than
                          >creating the shortcut by hand and using the shutil module?
                          >Thank you for any ideas.
                          >Mike
                          Either you copied wrong or the problem is:
                          >
                          "C:\"C:\Pro gram Files...
                          >
                          Note the C:\ is specified twice in the string.  I think it should read:
                          >
                           "C:\Program Files\Mozilla Firefox\firefox .exe" https:
                           \www.myCompanyW ebsite.com\auth \preauth.php"
                          >
                          -Larry
                          >
                          Yeah, I know that it's in there twice and that that is the problem.
                          But I'm not causing that extra C:\. I run it exactly as above and that
                          is what I get for the output. I think it's the COM object. Maybe I
                          better just re-post this to the PyWin32 list...
                          >
                          Thanks,
                          >
                          Mike
                          >
                          I use Inno Setup on most of my applications and use it to create my desktop,
                          quicklaunch and Start shortcuts.  Would that be an option for you?
                          >
                          -Larry
                          I use Inno too for my applications. However, in this case, I have to
                          create the shortcut as part of the login process based on what group
                          the user is in. Chris's solution worked for my needs and I think
                          Gabriel's will work too, if I figure it out.

                          Mike

                          Comment

                          • Tim Golden

                            #14
                            Re: Problem creating a shorcut

                            Mike Driscoll wrote:
                            Ah. I was unaware of the Arguments parameter. That works quite well.
                            Where does one find this information anyway? I think I found mine from
                            bits and pieces scattered in various tutorials.
                            The canonical place would be:



                            TJG

                            Comment

                            • Duncan Booth

                              #15
                              Re: Problem creating a shorcut

                              Tim Golden <mail@timgolden .me.ukwrote:
                              >3) You assume, that Firefox is always installed at C:\Program
                              >Files\Mozill a Firefox\firefox .exe
                              >However the path largely differs from system to system.
                              >
                              This is broadly true. However, it's fairly clear from the
                              phrase "the user's desktop" that the OP is working in some
                              kind of corporate environment where he can be fairly sure
                              where Firefox is installed by policy. In addition, it's not so
                              easy to find its path if it's not in the default place since apps
                              very rarely add their location to the system PATH these days
                              (and Firefox certainly doesn't). You could scan the registry for
                              its App Paths entry in the registry but I don't know if any other
                              way if it's not the default browser (which it's clear from the
                              original post it may not be).
                              >
                              It's not too hard to get the required command line from the registry:

                              import _winreg
                              print _winreg.QueryVa lue(_winreg.HKE Y_CLASSES_ROOT,
                              'FirefoxURL\she ll\open\command ')

                              and of course it throws an exception if firefox isn't installed.

                              Then just replace %1 with the url to get the actual command you need.

                              --
                              Duncan Booth http://kupuguy.blogspot.com

                              Comment

                              Working...