By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

help- run EXE from my program

P: 4
hi everybody

i want to run messenger from my program.. :
from os import *
system("C:\Program 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.
Dec 8 '08 #1
Share this Question
Share on Google+
6 Replies


micmast
100+
P: 144
maybe you could try:
system("'C:\Program 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
Dec 8 '08 #2

P: 4
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.
Dec 8 '08 #3

micmast
100+
P: 144
@ameboshh

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
Dec 8 '08 #4

P: 4
thank you very much!! :)
Dec 8 '08 #5

P: 4
nevermind :):):):):)
Dec 8 '08 #6

P: 28
what about popen?
cant it run executables?
Dec 8 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.