I have a script that runs against remote sites to map a drive and work with a file. I use Test-Connection
to make sure the remote server is alive, then attempt to map the location needed with net use
. My problem is that, depending on who runs the script a certain subset of remote locations is pingable, but cannot be mapped. Is there any way to make net use
time out after a shorter time, or another way to do this with Windows 7 or 2008 commands?
The correct answer is to probably figure out why they can not map the drive. To answer your question, net use does not have a time out command:
However if you want your script to keep on moving while your net use command figures it's self out you could use the
start
command to launch it in a new window and the normal script should be able to keep doing what ever you want it to do.start net use \\\computername\sharename x:
start your Timer run NET USE with "start" as supposed. send your Batch into a loop
Kind regards Johannes