VB logon script

Home Forums Scripting General Scripting VB logon script

This topic contains 4 replies, has 3 voices, and was last updated by Avatar Anonymous 2 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Avatar
    hilsoe
    Participant
    #166459

    I have this logon script based on Group membership. The first share mapped is a personal share, but I have some users who do not have a personal share. When theis users logon they do not get the other shares. How do I wrap the first share in a if-statment?

    Avatar
    wullieb1
    Moderator
    #245457

    Something like this should work

    Set wshNetwork = CreateObject(“WScript.Network”)
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)

    If objFSO.FolderExists(“\server” & wshNetwork.UserName) Then
    wshNetwork.MapNetworkDrive “u:”,”\server” & wshNetwork.UserName
    Else
    Wscript.Echo “Folder does not exist?”
    End If[/CODE]

    [url]https://technet.microsoft.com/en-us/library/ee198738.aspx[/url][CODE]Set wshNetwork = CreateObject(“WScript.Network”)
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)

    If objFSO.FolderExists(“\server” & wshNetwork.UserName) Then
    wshNetwork.MapNetworkDrive “u:”,”\server” & wshNetwork.UserName
    Else
    Wscript.Echo “Folder does not exist?”
    End If[/CODE]

    https://technet.microsoft.com/en-us/library/ee198738.aspx

    Avatar
    Anonymous
    #376694

    Looks ok, but I need to run through the rest of the script and no giving any messages about the missing folder.

    Avatar
    wullieb1
    Moderator
    #245459

    This should work. [ATTACH]n506155[/ATTACH]

    Avatar
    Anonymous
    #376695

    Thanks. Works.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.