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

Getting errors from popen in Windows

P: n/a

Is there a way in python to run a DOS command and have it return any errors that occur? I've
tried some of the different versions of peopen as well as the code listed below and none of
them give me the error that is displayed when I run the command from a prompt.

(Python 2.3, win32all, Windows NT/2K/XP)

strExec = 'copy "z:\MS Exchange Settings.NK2" "%USERPROFILE%\Application Data\Microsoft
\Outlook\"'
outdata=''
proc = os.popen(strExec)
while 1:
line = proc.readline()
if line:
print line
outdata=outdata+line
else:
break
Thanks for the help,
Chris
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.