How to shorten connection timeout?

  • Thread starter =?ISO-8859-2?Q?Ji=F8=ED_Jany=B9ka?=
  • 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
 
P

Pegasus \(MVP\)

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.
 
?

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

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. :(
 
R

Richard G. Harper

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top