473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

psexec and os.popen help

I'm trying to wrap a psexec command in a python script so I can capture
the results and generate an exception report. The problem I'm having is
that when I use x = os.popen("command") to do it, it runs, but the
content of x is empty. I know there should be output sent to it,
because when I run the command from the DOS prompt, it shows it. I
don't have this problem when wrapping other PSTools. Has anyone else
had this problem, or can someone try it and verify that it works, then
show me there work? I really appreciate it. Its been a late night.
Thanks

Dennis

Jan 6 '06 #1
2 3428
popen3 did the trick.

Thanks Jeff Gercken

Jan 7 '06 #2
de***********@gmail.com wrote:
popen3 did the trick.


Use the modules "subprocess" ... it solves many problems, including
the problem of too many similar functions. :-)

These functions (execl, execv, popen, popen2, popen3, ...) are relicts
from C and very unpythonic. It's IMHO always a better programming style
to use "subprocess".
Greets,

Volker

--
Volker Grabsch
---<<(())>>---
\frac{\left|\vartheta_0\times\{\ell,\kappa\in\Re\} \right|}{\sqrt
[G]{-\Gamma(\alpha)\cdot\mathcal{B}^{\left[\oint\!c_\hbar\right]}}}
Jan 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: bastiaannaber | last post by:
I am trying to write a program which uses popen but I have a problem. I want to detect if the program I call with popen has ended. For example: #include <stdio.h> #include <sys/types.h>...
5
by: damacy | last post by:
hello, everyone. i am trying to write a program which executes SQL commands stored in ..sql files. i wrote a function called psql() whose contents look like the following. .......
4
by: vol30w60 | last post by:
Hi folks, I am trying to launch a program with PHP code. I am running Apache on Windows XP SP2. I am using the method noted here: http://us2.php.net/manual/en/function.exec.php#59428 To...
3
by: Jesse | last post by:
Hi all, I have a problem using wget and Popen. I hope someone can help. -- Problem -- I want to use the command: wget -nv -O "dir/cpan.txt" "http://search.cpan.org" and capture all it's...
1
by: porsch55 | last post by:
m_oProc = new Process(); ProcessStartInfo oInfo; oInfo = new ProcessStartInfo("\\\\" + sSourceServer + "\\" + Environment.SystemDirectory.Replace("C:", "C$") + "\\psexec.exe", " \...
1
by: sjoshi | last post by:
Hi All I'm trying to use the Process/ProcessStartInfo class to use sysinternals psexec tool to run a remote command but I'm unable to get the output. The same command thru a DOS window runs fine...
4
by: =?Utf-8?B?emlubw==?= | last post by:
if I run the following from the command line as: C:\PsTools>psexec -u domain\myUser -p myPassword -i \\remoteServer cmd.exe it run successfully and it opens the command window on the remote...
8
by: clyfish | last post by:
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING UDP 0.0.0.0:445 *:* C:\> And os.system is OK....
1
by: Mark Shewfelt | last post by:
Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.