(Aug-25-2021, 11:38 PM)snippsat Wrote: I think the problem is that he us call() then there is no parametercapture_output
.
capture_output
only in run().
Ah, thank you. To avoid changing the command string I used for testing, I just modified the string in the thread and didn't notice that I was testing with run() instead of call().
I don't think there's a benefit to using call, so changing it to run should work (depending on the version available).
import subprocess try: subprocess.run("net use U: "+"\\\\"+itm+"\\c$\\SMTS\\TDR_Logs", shell=True, timeout=10, capture_output=True) except subprocess.TimeoutExpired: print(f"Server {itm} took too long to mount. Skipping...") continue #or break or return or whatever appropriate to go to the next server....