Mar-01-2024, 11:08 PM
Greetings to you all!
I’m trying to get some files from the remote hosts.
I’m using a ‘net use’ string for mapping drives and getting files.
Some of the hosts intermittently refused a connection.
I thought I would have a retry loop in the code to solve the problem, I’d like to see the number of retries.
For some reason, the snipped does not want to retry…
Here is a "retry" part of the code:
Any help is appreciated.
I’m trying to get some files from the remote hosts.
I’m using a ‘net use’ string for mapping drives and getting files.
Some of the hosts intermittently refused a connection.
I thought I would have a retry loop in the code to solve the problem, I’d like to see the number of retries.
For some reason, the snipped does not want to retry…

Here is a "retry" part of the code:
for retry in range(25): try: print(f" Try - {retry}") call("net use Z: /delete /yes") call("net use Z: "+"\\\\"+ips+"\\c$\\S_Files /u:SomeUser Somepass") break except: print ("Connection failed, retrying...") passThank you in advance!
Any help is appreciated.