| | |
opening an exe from Program Files directory in windows
Thread Solved |
I've just done a bit of digging around on python.org and found this:
http://bugs.python.org/issue1524
Looks like I'm not the first person to come up with this workaround....See the post made by daniel.weyh on the 25th June 2008.
Jas.
http://bugs.python.org/issue1524
Looks like I'm not the first person to come up with this workaround....See the post made by daniel.weyh on the 25th June 2008.
Jas.
Will be posting sparsely, still lots of band related stuff to do:
http://www.myspace.com/kinasis
http://www.myspace.com/kinasis
This problem has been around for a long time and not just with Python:
python Syntax (Toggle Plain Text)
# the "Microsoft kludge", quoting a string within a string fixes the # space-in-folder-name problem, tells the OS to use the whole string # including spaces as a single command # (make sure filename does not contain any spaces!) os.system('"C:/Program Files/IrfanView/i_view32.exe" ' + filename)
drink her pretty in burbank
•
•
•
•
python Syntax (Toggle Plain Text)
os.system('"C:/Program Files/IrfanView/i_view32.exe" ' + filename)
Hang on....Looking back at my failed scripts from when I was playing around, I had the " and the ' the wrong way around! Damn these fat drummer fingers! grrr! heh heh!

Thanks for that Ene! Yes that's far better than my solution!
Cheers for now,
Jas.
Will be posting sparsely, still lots of band related stuff to do:
http://www.myspace.com/kinasis
http://www.myspace.com/kinasis
•
•
•
•
just thinking... wouldnt it have made more sense to just change "Program files" to "Program_files" or something similar?
Simply renaming the 'Program Files' folder to 'Program_Files' would cause most (if not all) of your programs to either malfunction, or not work at all when you tried to run them.
The OS probably wouldn't take it too well either!
Plus any shortcuts you have for any programs in the 'Program Files' folder will also stop working...(e.g. desktop shortcuts and start menu links)
So in this case...No! Changing the folder name would definitely not be the best option. Ene's line of code is by far the best solution to the problem!
Cheers for now,
Jas.
Will be posting sparsely, still lots of band related stuff to do:
http://www.myspace.com/kinasis
http://www.myspace.com/kinasis
•
•
Join Date: Sep 2009
Posts: 113
Reputation:
Solved Threads: 22
Its actually not as tough as people are making it out to be, if you have a space you need to put ' ' or " " around it to clarify that it has a space, maybe try this:
I may be wrong, i might have just been using Linux too long
Python Syntax (Toggle Plain Text)
import os os.system("'C:\Winamp\Winamp.exe'")
I may be wrong, i might have just been using Linux too long
![]() |
Similar Threads
- Rundll.exe error, Not respodning when closing windows XP (Viruses, Spyware and other Nasties)
- Cannot find Windows Explorer (Windows NT / 2000 / XP)
- winupdate.exe problem (Viruses, Spyware and other Nasties)
- RunTime error C++ C: \Program Files|MusicmatchJukebox\mm_tray exe (Viruses, Spyware and other Nasties)
- Internet Explorer & Windows Explorer (desktop shortcuts) Won't Load! (Viruses, Spyware and other Nasties)
- I have this c:\windows\system32\z14.exe HELP!!!!!! (Viruses, Spyware and other Nasties)
- Error loading C:\WINNT\Downloaded Program Files\bridge.dll (Viruses, Spyware and other Nasties)
- Error loading C:\WINDOWS\Downloaded Program Files\bridge.dll (Viruses, Spyware and other Nasties)
- rundll error loading C:\PROGRA~1\INTERN~3\inetkw.dll (Viruses, Spyware and other Nasties)
- "WINDOWS\ SYSTEM\ BRIDGE.DLL" (Viruses, Spyware and other Nasties)
Other Threads in the Python Forum
- Previous Thread: Text Files
- Next Thread: Cookies
Views: 1325 | Replies: 22
| Thread Tools | Search this Thread |
Tag cloud for Python
aliased application array beginner c++ c/c++ change character class client code command convert count create csv ctypes database dictionary django dll error examples excel exe extensions fdlib file float format framework ftp function graphics gui homework image images import input keyboard library line linux list lists logging loop loops microcontroller mouse mysql mysqldb number numbers output parse parsing path port prime processing program programming py2exe pygame pygtk pyqt python random raw_input recursion recursive redirect remote scrolledtext server socket ssh stdout string strings syntax table terminal text thread threading tkinter transparency tuple tutorial ubuntu unicode variable variables web windows wordgame wxpython







