locked
File paths RRS feed

  • Question

  • Maybe im missing something here but I have A gadget that needs to run an exe file that is included with the gadget. Every thing works fine when i use an absolute path i.e. "C:\\Program Files\\Windows Sidebar\\Gadgets\\WinampGadget.gadget\\winampexe\\winampcc.exe" however when i try to use a relitave path i.e. "\\winampexe\\winampcc.exe" I get a file not found kind of error.

    Heres the whole dir...

    WinampGadget.gadget\

         Winamp Gadget.html

         gadget.xml

         winampexe\

                winampcc.exe

                winampcc.ini

         images\

                just a bunch of images..

    Also this is how i am running the exe "System.Shell.execute("\\winampexe\\winampcc.exe", param);"

    BTW this happens in Vista RTM Home Pro and the xp port (I use XP mostly at this point in time and just use the patched sidebar for twsting and development)

    Sunday, February 4, 2007 9:35 PM

Answers

  • Try

    System.Shell.execute(System.Gadget.path + "\\winampexe\\winampcc.exe", param);

    Haven't tried it myself but I can't see why it wouldn't work.

    Andy

    Sunday, February 4, 2007 11:59 PM

All replies

  • Try

    System.Shell.execute(System.Gadget.path + "\\winampexe\\winampcc.exe", param);

    Haven't tried it myself but I can't see why it wouldn't work.

    Andy

    Sunday, February 4, 2007 11:59 PM
  • You can't use relative paths, the method Andy E suggests is the correct way to implement it.
    Monday, February 5, 2007 9:57 AM