How to shorten connection timeout?

  • Thread starter Thread starter =?ISO-8859-2?Q?Ji=F8=ED_Jany=B9ka?=
  • Start date Start date
?

=?ISO-8859-2?Q?Ji=F8=ED_Jany=B9ka?=

Hi,

is it possible to shorten connection timeout (somewhere in winsock?)
when waiting for the result of the command:

IF EXIST \\server\share (
REM ... Do something ...
)

?

When the server is down, the timeout takes almost half a minute and it's
too long ... :(


Thx
J.Janyska
 
Try this instead:

@echo off
ping aaa.bbb.ccc.ddd -n 1 | find /i "bytes=" > nul
if %ErrorLevel%==0 (
do something
and another thing
)

Replace aaa.bbb.ccc.ddd with your server's IP address.
 
Yes, I think this pinging will be my final solution I wanted to avoid. :(

I didn't mention that in fact there is not \\server\share , but

IF EXIST \\domain_name\DFSroot\DFSlink1\file.xxx ( do something )
IF EXIST \\domain_name\DFSroot\DFSlink2\file.xxx ( do something )

So my goal was to get rid of pinging the names of particular servers,
which I even don't need to know, when mapping the drives through DFS.

I also tryed to find a commandline utility which allows to check the
status of a DFSlink (online/offline). I spend some time with DFSCMD and
Dfsutil but didn't succeed. It seems I can check it only in DFS mmc
console. :(
 
There is no way to shorten or disable the timeout period in searching for a
network resource or server. If the ping solution doesn't work then that's
about the extent of it - no solution is possible.

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* PLEASE post all messages and replies in the newsgroups
* for the benefit of all. Private mail is usually not replied to.
* My website, such as it is ... http://rgharper.mvps.org/
* HELP us help YOU ... http://www.dts-l.org/goodpost.htm
 
Back
Top