On my main PC I have automated script which is looking and processing data inside of a few network drives of some remote PCs. But sometimes are network drive disconnected and I need to automaticaly refresh it's state.
Scenario:
It can happen that one of the remote PC is off and then I must for another reason restart the main PC. And then after I start the main PC on a network drive icon will appear a red sign "X" which means that a network drive of the remote PC is disconnected which is still OK.But this "X" disconnected state persists on the main PC even when somebody start the remote PC. Only when I manually click with my mouse on that network drive a "X" sign disappear and my script start working.
Scenario scerenshot
Is there any way how to automatically refresh/renew network drives in some interval e.g. via task scheduler?
But not a solution like delete drive and mount it again.
I have tried some things but without success
How do I refresh network drives that were not accessible during boot up
net use x: <value of RemotePath for X drive>
Mapped drive connection to network share may be lost
net config server /autodisconnect:-1