1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Net Use timeout problem

Discussion in 'Legacy Windows' started by okramo, 2007/02/26.

  1. 2007/02/26
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0
    Hi,

    When I use net use x: \\192.168.2.2\c everything is OK while connection is OK, but if connection with 192.168.2.2 isn't established then net use waits for certain time before he displays the message that there is some problem with connection.

    I want to reduce that time that Net Use waits to see if connection is OK...

    If net use can't find connection with 192.168.2.2 in about 5sec he can stop searching or waiting.

    Hot to do that??

    thx
     
  2. 2007/02/28
    mattman

    mattman Inactive Alumni

    Joined:
    2002/06/10
    Messages:
    8,198
    Likes Received:
    63
    Basically, I would think, the network is connected, Net Use runs. The network is not connected, Net Use looks for a nonexistent connection.

    Look at stopping Net Use from running when there is no connection (check the settings).

    Sorry, maybe simplistic, but I have never come across Net Use.

    Matt
     

  3. to hide this advert.

  4. 2007/03/03
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0

    I've checked what net use options offer me but I can't find what I need.

    Other thing could be done - I could edit registry to cut down timeout (editing TCP/IP options) and I'll try that... hope it will work
     
  5. 2007/03/06
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    You could try this:
    Code:
    @echo off
    ping 192.168.2.2 -n 1 > ping.txt
    findstr  "Request timed out" ping.txt
    IF ERRORLEVEL 1 net use x: \\192.168.2.2\c
    This code tries to ping 192.168.2.2 and only processes the net use command if the ping request doesn't time out.

    Oh, and by the way. I trust that the name "c" for the share doesn't mean you are sharing the whole C: drive. This isn't a good idea as it makes it easier for network malware to access your system. Identify the folder containing the documents or data you want to share and then just share that folder.
     
  6. 2007/03/07
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0
    I am not using whole C document - have mapped folder on the drive.

    Other thing, could you try by yourself to simulate that connection with 192.168.2.2 isn't existing and run this script. You'll see that some time will past before the window of command prompt closes.

    I want to reduce that time as much as possible when connection isn't detected. if you understand me...
     
  7. 2007/03/07
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    My point is that the timeout for ping is a lot quicker than that for "net use ". Therefore if you check the PC is accessible with a ping before running "net use" (which is what my script does), the timeout for the whole process is greatly reduced if the target PC is off line.

    Have you tried my script?
     
  8. 2007/03/07
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0
    Yes, I've tried your script and that's why I replied. Timeout for the ping is pretty much the same as net use for me :/
    I tried script on Win XP + SP2, but I'll try it also on Win98 SE.

    When IP is founded script is working very fast, but in other cases timeout is too long - almost about 12 sec.

    Could it be the reason of slowness that I've got on computer about 5-6 folders and drives already mapped?

    Also I'll try the script on other computer, cause maybe the problem is with my computer...

    anyway thx
     
  9. 2007/03/07
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Are you mapping a single folder from that remote PC? If you are doing multiple mappings to the same PC, you could set up the batch file to test for the presence of the remote PC once and then only continue to do the mappings if it succeeds (rather than running the check with each mapping).
     
  10. 2007/03/07
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0
    Yes, I'am mapping just one folder from specified remote PC. But also I'am mapping some other folders and drives from local network - so maybe I thought that this may be the problem...

    I'll test script on other PC and report results ;)
     
  11. 2007/03/08
    okramo

    okramo Inactive Thread Starter

    Joined:
    2007/02/19
    Messages:
    16
    Likes Received:
    0
    Yes, the time is reduced for some period but still I think that it could be reduced more...

    but, thanks very much for the script and I'll use it for my needs ;)

    thx, again
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.