Page 2 of 3 <123>
Topic Options
#1801 - 2000-02-29 08:06 AM Re: NT printer connections
Anonymous
Unregistered


Success!!!!

I tried the script on a machine in room 1 and bingo it connected to the correct printers, but; i tried it in room 2 and it connected to room 1 printers??


Top
#1802 - 2000-02-29 08:59 AM Re: NT printer connections
Anonymous
Unregistered


Hi Mike

Err, is that success?

I reckon your script should look like:

;************
$SysNo = substr(@wksta,LEN(@WKSTA)-2,2)

IF $SysNo < "30"
AT (4,4) "This is connecting to U18"
addprinterconnection(\\upperserver\EpsonU18)
addprinterconnection(\\upperserver\KyoU18)
else
At (4,4) "This is connecting to U26"
addprinterconnection(\\upperserver\KyoU26)
addprinterconnection(\\upperserver\EpsonU26)
endif
;******************

I am assuming U18 is Room1 and U26 is Room2? If I am wrong please change the < to a > .

Your close

Many Kixers out there will be giggling at this thread.

Rgds
Don

Top
#1803 - 2000-02-29 10:11 AM Re: NT printer connections
Anonymous
Unregistered


No my script looks like the following

;************
$wksta=@wksta
$a=substr($wksta,5,2) ;take last two char
$what_rm=val($a) ;change to number

if $what_rm > 30
AT (4,4) "This is connecting to U18"
addprinterconnection(\\upperserver\EpsonU18)
addprinterconnection(\\upperserver\KyoU18)
else
At (4,4) "This is connecting to U26"
addprinterconnection(\\upperserver\KyoU26)
addprinterconnection(\\upperserver\EpsonU26)
endif
;******************

I tried this on a machine that was in U26, now it connects to the printers in U26, but when i logged on in U18 it connects to U26 printers??????


Top
#1804 - 2000-02-29 11:27 AM Re: NT printer connections
Anonymous
Unregistered


Hi Mike

Do a debug on this (copy it to a test.kix and run test.kix in debug mode) and check the variable returned. If the machine name is UPPER00 then the variable should be 00 etc.


;************
$wksta=@wksta
$a=substr($wksta,5,2) ;take last two char
$what_rm=val($a) ;change to number

if $what_rm > "30"
AT (4,4) "The variable value is $what_rm"
sleep 3
else
At (4,4) "The variable value is $what_rm"
sleep 3
endif
;******************

Rgds
Don

Top
#1805 - 2000-03-01 03:09 AM Re: NT printer connections
Anonymous
Unregistered


The value returned is "0"

then the debug exits

Top
#1806 - 2000-03-01 03:20 AM Re: NT printer connections
Anonymous
Unregistered


Hi Mike

Try it on a different machine to test the variable returned. Just to check the numbers are correct.

Good luck.

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#1807 - 2000-03-05 08:35 AM Re: NT printer connections
Anonymous
Unregistered


Sorry chaps i have been ill the past few days, so i'll carry on with my test on monday the 5th march

Mike..

Top
#1808 - 2000-03-05 01:55 PM Re: NT printer connections
Anonymous
Unregistered


Hi Mike

Sorry to hear that bud! What was it, tummy bug or a bad pint?

Rgds
Don

Top
#1809 - 2000-03-06 06:46 AM Re: NT printer connections
Anonymous
Unregistered


Well im back and that was a lame joke D

Right heres what i did i tried that script you gave me as a test to debug.

i tried it on the machine called "UPPER07" and the return value was 0?

so what is wrong??

Mike..

Top
#1810 - 2000-03-06 07:18 AM Re: NT printer connections
Anonymous
Unregistered


Mike

I am full o lame jokes Mike

The $what_rm seems to be always 0 from what you have posted.

When I said your script should look like this:

$SysNo = substr(@wksta,LEN(@WKSTA)-2,2)

IF $SysNo < "30"
AT (4,4) "$SysNo is connecting to U18"
addprinterconnection(\\upperserver\EpsonU18)
addprinterconnection(\\upperserver\KyoU18)
else
At (4,4) "$SysNo is connecting to U26"
addprinterconnection(\\upperserver\KyoU26)
addprinterconnection(\\upperserver\EpsonU26)
endif

I meant copy this code and test it out in a test script!

The variable $SysNo SHOULD be the last two digits of your workstation number!

We'll get there!
Rgds
Don

Top
#1811 - 2000-03-06 07:42 AM Re: NT printer connections
Anonymous
Unregistered


Ok i have copied the script you gave me and what its doing is returning the "R" from the name "UPPER" and the the "0" from "07"

I do hope we will get this soon because theres something else i wanna ask

Top
#1812 - 2000-03-06 07:50 AM Re: NT printer connections
Anonymous
Unregistered


Right i just changed the -2,2) to -1,2) and the variable returned was 07 but then it connected to the Room 18 B&W printer but not the colour??????

This is getting on my nerves....

It almost looks as though it doesnt recognize double figure numbers!

Top
#1813 - 2000-03-06 09:48 AM Re: NT printer connections
Anonymous
Unregistered


Mike

At least your getting the correct numbers returned by your variable.

These ARE NT workstations your working with? The Kixtart manual does state that ADDPRINTERCONNECTION works with NT only!

If so you could the check the @error value of the adprinterconnection to see what is happening. See the Kixtart manual for more details.

Rgds
Don



Top
#1814 - 2000-03-06 10:26 AM Re: NT printer connections
Anonymous
Unregistered


I will do that tonight cause im just leaving work..

see ya tomorow

Top
#1815 - 2000-03-06 06:52 PM Re: NT printer connections
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
here try this your code looks ok, these are NT computers right?

------------------------------------------$wksta=@wksta
$a=substr($wksta,6,2) ;take last two char
$what_rm = val($a) ;change to number

select
case $what_rm <= 29
At (4,4) "This is connecting to U26"
;addprinterconnection(\\upperserver\KyoU26)
;addprinterconnection(\\upperserver\EpsonU26)
case $what_rm >= 30
AT (4,4) "This is connecting to U18"
;addprinterconnection(\\upperserver\KyoU18)
;addprinterconnection(\\upperserver\EpsonU18)
endselect
------------------------------------------

Top
#1816 - 2000-03-07 08:04 AM Re: NT printer connections
Anonymous
Unregistered


Ok guys im getting quite bvusy at work today so i'll start posting again as soon as i have finished.

Mike..

Top
#1817 - 2000-03-08 03:13 AM Re: NT printer connections
Anonymous
Unregistered


Hi Guys, the script Bryce gave me seems to do the trick perfectly

A big thank you to everyone who helped me out of this nightmare.

an extra special Thanxs to DDavidson, if your ever in the UK, Hull area i'll buy you a drink mate.

Now im gonna start you lot of again in a new post

Cheers

Top
#1818 - 2000-03-08 03:15 AM Re: NT printer connections
Anonymous
Unregistered


Hi Mike

Sorry I was not able to help. Nice one Bryce

Mike I might hold you up on that one day I was born in Hull and do sometimes visit.

Bye

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#1819 - 2000-03-08 05:53 AM Re: NT printer connections
Anonymous
Unregistered


Hello im back.

i have made other scripts that do the same thing for other rooms and they work fine by them selfs but i tried making a script to run the other scripts depending on the computer name i have posted it below its pretty self explanitory. but the problem is that no printers are being installed? Help 1 more time pleaze.

$SysNo = substr(@wksta,LEN(@WKSTA)-7,7)

IF $SysNo = "SCIENCE"
CALL science.kix
endif

$SysNox = substr(@wksta,LEN(@WKSTA)-4,4)

IF $SysNox = "TECH"
CALL tech.kix
endif

$SysNop = substr(@wksta,LEN(@WKSTA)-5,5)

IF $Sysnop = "UPPER"
CALL printers.kix

endif
EXIT

Top
#1820 - 2000-03-09 05:22 AM Re: NT printer connections
Anonymous
Unregistered


Mike

How about posting that last one again but as a NEW topic and showing the other scripts that are called?

Just athought.

Ta

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
Page 2 of 3 <123>


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

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.073 seconds in which 0.033 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