Page 1 of 1 1
Topic Options
#200229 - 2010-10-11 09:40 AM Map drives - timeout to move on exec if netw. drive/printer not responding
Curious Offline
Getting the hang of it

Registered: 2004-02-16
Posts: 61
Need some input doing what's mentioned above.

My logon-script looks like segments like this:

 Code:
At (1,0) "Mapping disks, adding printers..."

If InGroup("domain users")
	Use d: "$fmtefil1\felles_gammel"
	sleep 0.1 ? "Mappet disk d"
	Use f: "$fmtefil1\felles_mapper"
	sleep 0.1 ? "Mappet disk f"
	Use h: "$fmtefil1\brukere"
	Sleep 0.1 ? "Mappet disk h"
	Use i: "$fmtefil1\felles"
	sleep 0.1 ? "Mappet disk i"
	Use r: "$fmtefil1\brukere\@userid" 
	sleep 0.1 ? "Mappet disk r"
	Use p: "$fmtefil1\Programmer"
	sleep 0.1 ? "Mappet disk p"
	Use u: "$fmtefil1\etat_ora"
	sleep 0.1? "Mappet disk u"
EndIf

If InGroup("gAdmaArkiv")
	If AddPrinterConnection ("$fmteprint\Lba_multi") = 0 ? "Added printer Lba_multi"
	EndIf
	Sleep 0.0
	If AddPrinterConnection ("$fmteprint\Arkiv_multi") = 0 ? "Added printer Arkiv_multi"
	EndIf
	Sleep 0.0
	If SetDefaultPrinter ("$fmteprint\Arkiv_multi")= 0 ? "Default printer is Arkiv_multi"
	EndIf
	Sleep 0.1
EndIf



Many things are being mapped, depending of the group the user belongs to.

Sometimes a nas-box (or anything non-crucial) is not reachable.
This causes the script to stop for quite a while when executing.

I'm looking for a smart way to continue executing the script if this occurs.

Have looked into do.. while loop etc, but can't quite get this functional.

Good input will be appreciated.

Regards /J
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..

Top
#200230 - 2010-10-11 11:06 AM Re: Map drives - timeout to move on exec if netw. drive/printer not responding [Re: Curious]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
There is a UDF called Ping(). If you use this UDF to ping the server and only map when it gets a reply you can avoid most of the timeouts this way.

Ping() - checks for reply , or returns ip-address of remote host
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200234 - 2010-10-11 05:29 PM Re: Map drives - timeout to move on exec if netw. drive/printer not responding [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Mart
...you can avoid most of the timeouts this way.
Often a device can still respond to pings but the share still be dead. Better IMHO to fix the reliability issue.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#200253 - 2010-10-14 09:31 AM Re: Map drives - timeout to move on exec if netw. drive/printer not responding [Re: Les]
Curious Offline
Getting the hang of it

Registered: 2004-02-16
Posts: 61
I was thinking about checking with ping, but as Les said, there can still be an issue.

 Originally Posted By: Les
Better IMHO to fix the reliability issue.


Les: How would you suggest I approach doing this?

/J
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..

Top
#200254 - 2010-10-14 09:49 AM Re: Map drives - timeout to move on exec if netw. drive/printer not responding [Re: Curious]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
How to fix the issue depends on exactly what issues and your network setup.

If one of the devices that is not accessible sometimes is behind a router or switch that is a bit screwed up change the switch or router, change the cabling, check if the NIC's are having issues, etc..... Might take some time but you will benefit from it in the long run.


Edited by Mart (2010-10-14 09:49 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200268 - 2010-10-15 09:14 AM Re: Map drives - timeout to move on exec if netw. drive/printer not responding [Re: Mart]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Pinging before mapping is still a valid option. It will tell you much more quickly that you've got a problem where there is an issue with connectivity. If you've got X drives to map then why wait X minutes retrying a device that you know is not available, especially if the drives map to the same device? If the mapping is never going to finish successfully it serves no purpose other than to delay notifiying your users that you have a problem.

You should absolutely attend to any underlying issues, but if you have kit that you know will regularly be unavailable for various reasons then don't penalise your end users by delaying them for no purpose.

As regards mapping failures when the device *is* responding to pings there is no silver bullet. Just about any really useful tests will be subject to the same delay as the mapping so won't save you anything.

What you can do where drives map to a common device is check the @ERROR value returned - if the error is a timeout then don't bother to try and map and other drives to the same device as it's likely to timeout for them as well. The same goes for printers which map to a common print server.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.056 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org