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.