Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another logon script question... sorry! 1

Status
Not open for further replies.

acford

MIS
Nov 12, 2003
90
0
0
GB
Hi,

I used to know a little about VB Script... I must have had a knock on the head or something?!?

I want to run a script depending on computer name. I have a bunch of machines I do not want it to run on when a user logs on. Basically:

Dim obj
Set obj = CreateObject("Wscript.Network")
If obj.ComputerName = "this", "that" or "me" Then
'do nothing
Else
<I have some code to go here>

So the problem I have is the "this", "that" or "me", how to check multiple computer names...

I know one of you guys will come back straight away with what I need.


Thanks
Andrew
 
Select Case obj.ComputerName
Case "this", "that", "me"
'do nothing
Case Else
'do something
End Select

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top