Page 1 of 1 1
Topic Options
#34419 - 2002-12-11 11:54 AM select on workstation name
vanloon Offline
Fresh Scripter

Registered: 2002-05-27
Posts: 34
Hi,

Whe have laptop and desktop users and I want to give them 2 seperate scripts. How do I make it possible that when a machine name starts with lts... is starts the laptop script and when the machine starts with pcs... it starts the desktop script.

Thanks

Michel

Top
#34420 - 2002-12-12 12:03 AM Re: select on workstation name
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Thats a bit difficult !

It was discussed before , but had various special solutions (remember one where to search for pcmcia in registry )

Please do a search on Scripts forum , sure you will get some hits
_________________________



Top
#34421 - 2002-12-12 12:27 AM Re: select on workstation name
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

detect if notebook or pc
laptop help...
Determining if a PC is a workstation or a laptop
detecting laptops
detect if notebook or pc

Another way is based on manufactory Readvalue Question? SystemViosVersion
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#34422 - 2002-12-12 12:29 AM Re: select on workstation name
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Wait !

You said 'Select on Workstation name' in Topic heading [Big Grin]

If you have a good naming convention differentiating between Notebooks and PC's it should be done easily with some String Manipulation :

Lets say your Notebooks start all with the Letter 'L' and your PCs with 'W'

start a script as logon script that only checks and calls specific other scripts like :

code:
select
case substr(@wksta,1,1) = "L"
run @scriptdir + '\Notebooks.kix'
case substr(@wksta,1,1) = "W"
run @scriptdir + '\Workstations.kix'
case 1
"Naming convention not fulfilled ... logging you off !" $ = shutdown("","",1,0)
endselect

_________________________



Top
#34423 - 2002-12-11 03:13 PM Re: select on workstation name
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Includes different ways to branch.
code:
$LaptopID='LTS'
$PCID='PCS'
select
case left(@WKSTA,len($LaptopID))=$LaptopID
; it's a laptop
call laptop.kix
gosub laptopscript
$laptop=1
$pc=0
case left(@WKSTA,len($PCID))=$PCID
; it's a PC
call pc.kix
gosub pcscript
$laptop=0
$pc=1
case 1
; it's soemthing else
endselect

_________________________
There are two types of vessels, submarines and targets.

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 1057 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.058 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

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