Page 1 of 1 1
Topic Options
#203242 - 2011-10-13 12:10 AM IF address is 192.168.1.X or 192.168.2.X
IMan Offline
Fresh Scripter

Registered: 2009-04-23
Posts: 15
Loc: California
what is the best way to have the script map printers per location if there are more then one set of IP addresses at one location. So if the user is on the wired network they will have a different IP from the wireless as well as if they were in another office. Would the InStr(@IPAddress0,"") work best? if so how do i properly lay it out, all my tests have failed to do it correctly.

example:

IF computer IP address is 192.168.1.X or 192.168.2.X
ADDPRINTERCONNECTION ("\\server\printer")
ENDIF


Edited by IMan (2011-10-13 12:56 AM)

Top
#203243 - 2011-10-13 12:56 AM Re: IF address is 192.168.1.1 or 192.168.2.1 [Re: IMan]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
It's probably the blank space padding in the ipaddress macro that is getting you. Try this...

 Code:
If InStr(Join(Split(@IPAddress0," "),""),"192.168.1.") OR InStr(Join(Split(@IPAddress0," "),""),"192.168.2.")
   AddPrinterConnection("\\server\printer")
Endif

Top
#203244 - 2011-10-13 12:57 AM Re: IF address is 192.168.1.1 or 192.168.2.1 [Re: ShaneEP]
IMan Offline
Fresh Scripter

Registered: 2009-04-23
Posts: 15
Loc: California
thanks, ill give it a try.
Top
#203245 - 2011-10-13 01:21 AM Re: IF address is 192.168.1.1 or 192.168.2.1 [Re: IMan]
IMan Offline
Fresh Scripter

Registered: 2009-04-23
Posts: 15
Loc: California
worked first try, thanks for the help!
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 525 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.143 seconds in which 0.113 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