Quantcast
Channel: ActiveState Community Site - ActivePython discussion
Viewing all articles
Browse latest Browse all 75

Capturing diskpart output under elevated Windows 7 permissions.

$
0
0

I need to run diskpart in my python script under Windows 7 and capture its output. I run the script in elevated mode; it runs but I can't capture the output and thus can't determine if it was successful. Here's its invocation:

win32api.ShellExecute(0, runas, diskpart, /s C:\TEMP\mapRHD.dp > C:\TEMP\diskpart.out, C:\Python3, 1)

The C:\TEMP\mapRHD.dp file doesn't get written.

What am I doing wrong and is there a better way to get this done?

Thank you.


Viewing all articles
Browse latest Browse all 75

Trending Articles