1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB Code Help

Discussion in 'Software Development' started by driver_uk2001, Jan 26, 2007.

Thread Status:
Not open for further replies.
  1. driver_uk2001

    driver_uk2001 Thread Starter

    Joined:
    Mar 30, 2002
    Messages:
    526
    Hi i am trying to create a VB logon script so that on connect if the users are in the certain groups it will connect to the specified folders and also i am trying to add printers to each user automatically. can anyone tell me what is wrong with this code please?

    If InGroup("Year 00")
    USE S: \\rossmeresrv\joint\00
    EndIf
    If InGroup("Year 01")
    USE S: \\rossmeresrv\joint\01
    EndIf
    If InGroup("Year 02")
    USE S: \\rossmeresrv\joint\02
    EndIf
    If InGroup("Year 03")
    USE S: \\rossmeresrv\joint\03
    EndIf
    If InGroup("Year 96")
    USE S: \\rossmeresrv\joint\96
    EndIf
    If InGroup("Year 97")
    USE S: \\rossmeresrv\joint\97
    EndIf
    If InGroup("Year 98")
    USE S: \\rossmeresrv\joint\98
    EndIf
    If InGroup("Year 99")
    USE S: \\rossmeresrv\joint\99
    EndIf

    addPrinterConnection (\\sx3200247\Printers\HP 1315-Colour)
    addPrinterConnection (\\rossmeresrv\T612)
    SetDefaultPrinter(\\rossmeresrv\T612)
    addPrinterConnection (wirelessdt04\Mini.Suite.Main)

    Thanx

    Mick
     
  2. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    You need to shell out to the NET command for the "USE \\resource\path" command.

    Shell( "net.exe", "use \\resource\path", vbNormalFocus )
     
  3. driver_uk2001

    driver_uk2001 Thread Starter

    Joined:
    Mar 30, 2002
    Messages:
    526
    Hi sorry i wasnt specific in my first post. The problem i have is that the printers are not auto adding to users when they log on. How can i solve this?

    Thanx
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/538496

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice