help- run EXE from my program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ameboshh
    New Member
    • Dec 2008
    • 4

    help- run EXE from my program

    hi everybody

    i want to run messenger from my program.. :
    from os import *
    system("C:\Prog ram Files\Windows Live\Messenger\ msnmsgr.exe")

    but it gives error- 'C:\Program' is not recognized as an internal or external command, operable program or batch file.

    what to do? how can i run messenger from my program?

    thanks alot.
  • micmast
    New Member
    • Mar 2008
    • 144

    #2
    maybe you could try:
    system("'C:\Pro gram Files\Windows Live\Messenger\ msnmsgr.exe'")

    I think the system command will just "paste" it into a commandprompt and he will the the following
    > C:\Program Files\Windows Live\Messenger\ msnmsgr.exe

    ie execute program with the rest as arguments

    Comment

    • ameboshh
      New Member
      • Dec 2008
      • 4

      #3
      so

      it doesnt work too... - the syntax is incorrect
      if msnmsgr is located in c:\ so it works.. but msnmsgr locates in C:\Program Files\Windows Live\Messenger\ msnmsgr.exe ( there are spaces so it doesnt work)

      help please :( subprocess.call - the same problem.

      Comment

      • micmast
        New Member
        • Mar 2008
        • 144

        #4
        Originally posted by ameboshh
        it doesnt work too... - the syntax is incorrect
        if msnmsgr is located in c:\ so it works.. but msnmsgr locates in C:\Program Files\Windows Live\Messenger\ msnmsgr.exe ( there are spaces so it doesnt work)

        help please :( subprocess.call - the same problem.

        you are right, it didn't work, sorry my mistake
        but I found the correct answer
        use the ^ character to escape the space
        C:\Program^ Files\Windows^ Live\Messenger\ msnmsgr.exe

        Comment

        • ameboshh
          New Member
          • Dec 2008
          • 4

          #5
          :)

          thank you very much!! :)

          Comment

          • ameboshh
            New Member
            • Dec 2008
            • 4

            #6
            help again :(

            nevermind :):):):):)

            Comment

            • Apostle
              New Member
              • Dec 2008
              • 28

              #7
              what about popen?
              cant it run executables?

              Comment

              Working...