Another Login Script (Groups)

Home Forums Scripting Windows Script Host Another Login Script (Groups)

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    jp1
    Member
    #149394

    I’m just getting my feet wet with VBScripts and I’m trying to find a cleaner way of running a command at login if a user is a member of a particular group. The code segment below works, but I’m using a lot of If’s and ElseIf’s and wondering if there was a nicer/cleaner way to do this?

    If InStr(strGroup, lcase(Group_Name_1)) Then
    Set wshShell = WScript.CreateObject (“WSCript.shell”)
    wshshell.run “auth.bat”
    set wshshell = nothing
    ElseIf InStr(strGroup, lcase(Group_Name_2)) Then
    Set wshShell = WScript.CreateObject (“WSCript.shell”)
    wshshell.run “auth.bat”
    set wshshell = nothing
    End If

    I have about 8 groups that I’m doing this for. Basically what I’m looking for is, if a user is in one of these groups, then run the “auth.bat” file.
    Thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.