Remote location’s status “Disconnected”, how to keep it connected (OK)? [net-use-command]

net-usenetworking

I have an script that keeps running, under some scenarios, it needs to contact a server (\\us-sign). From time to time, if this server remains uncontacted for a while, the next time my script needs it, it will ask for my credentials.

What I found is that, after such thing happening and using net use, such server will be displayed as disconnected. if I type "net use \\us-sign", it won't ask me neither user nor password, what makes me believe, my credentials for such server are still "valid", nonetheless, its status will remain "disconnected".

This script is supposed to help us automate some procedures, but the need to keep a watch on it shall it request for credentials, it kind of defeats the purpose.

How can I keep its status "OK" no matter how long it is not being contacted?

Best Answer

NET CONFIG /SERVER autodisconnect:-1