+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
Windows Thread, Computer Startup Scripts in Technical; Forgive my ignorance on this one. Trying to get a vb script to run on computer startup to attach printers. ...
  1. #1
    Spot's Avatar
    Join Date
    Aug 2005
    Location
    Corby, Northants
    Posts
    8
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Computer Startup Scripts

    Forgive my ignorance on this one. Trying to get a vb script to run on computer startup to attach printers.

    I've added the script to the Startup Scripts under Computer Configuration\Windows Settings\Scripts and assigned the gpo to a test ou with one pc in for testing.

    When logging on the machine says it is processing scripts, but the printer info does not get set.

    Once logged on, I can run the script as a student user and the printer script works fine - slight issue of students having to agree to open a vbs file though...

    I've copied the "physical" script file itself to the policies' "Machine\Script\Start Up" folder too.

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Computer Startup Scripts

    Is the script trying to access information that doesn't exist? eg, logged in user info?

  3. #3
    Spot's Avatar
    Join Date
    Aug 2005
    Location
    Corby, Northants
    Posts
    8
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Computer Startup Scripts

    Hi Geoff

    It's just getting the computer name and connecting to a network printer. It's based on the vb script discussed in another forum here ("Setting a permanent default printer"). I've just deleted the stuff not applicable to us and changed the rooms / printer info.

    I started getting a little desparate so have started sticking 'msgbox' statements in to test the select case stuff. It seems to pick up the room info ok and goes to the correct section to add the printer - just doesn't add the chuffing printer!

    I've enclosed the script to for anyones' perusal - note extension changed to ".txt". Again - work in progress and the msgbox statements throughout are deliberate - to be removed when the darn thing works!

    Just checked the security permissions on the server printer share - Everyone has 'Print' access. Shouldn't need any more than that should it?

    All suggestions gratefully received!
    Attached Files Attached Files

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Computer Startup Scripts

    Network printers are per user settings. You can't add them at machine start up. Run the script at user login instead.

  5. #5
    Spot's Avatar
    Join Date
    Aug 2005
    Location
    Corby, Northants
    Posts
    8
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Computer Startup Scripts

    Ta very much Geoff - I'll try with a user on Monday.

    Is there a way I can attach printers at machine startup instead of at user logon?

  6. #6

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Computer Startup Scripts

    You can setup a network printer as a local printer if you set the printer port to TCP/IP (assuming you have printers that support that). I've no idea how to script that though. Works ok thru the add printer wizard though.

  7. #7
    StewartKnight's Avatar
    Join Date
    Jun 2005
    Posts
    1,587
    Thank Post
    2
    Thanked 27 Times in 21 Posts
    Rep Power
    30

    Re: Computer Startup Scripts

    Sorry Geoff, but I beg to differ! In documents & Settings, all users, start menu, programs, startup, add the script. Thats how I've done it. If you still have problems post again, and I'll send you my script, which is currently working on 100 computers & 50 laptops!

  8. #8

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Computer Startup Scripts

    That script will run at login though Stewart.

  9. #9

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: Computer Startup Scripts

    With Geoff there Stewart - I've always used my scripts at login through a GPO.

  10. #10
    StewartKnight's Avatar
    Join Date
    Jun 2005
    Posts
    1,587
    Thank Post
    2
    Thanked 27 Times in 21 Posts
    Rep Power
    30

    Re: Computer Startup Scripts

    Geoff says that you have to set up a tcp/ip printer port. What I'm saying is, you don't have to. Share the printers on the server, then use the script to attach the printers to the local machine. This method means you have only 4 small lines of code, and it does'nt take a second to run, No drivers to install, and if you change the printer, as long as you give it the same share name, the printer is instantly available for the users!

  11. #11
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,958
    Thank Post
    248
    Thanked 49 Times in 45 Posts
    Blog Entries
    2
    Rep Power
    46

    Re: Computer Startup Scripts

    Stewart - the thrust of the thread authors question is for a machine startup script, not a user logon script.

  12. #12
    StewartKnight's Avatar
    Join Date
    Jun 2005
    Posts
    1,587
    Thank Post
    2
    Thanked 27 Times in 21 Posts
    Rep Power
    30

    Re: Computer Startup Scripts

    I think you're getting a little picky there! All this poor chap want to do is get his printers to work. I'm sure he doesn't care if it's when the machine boots, or the user logs on!

  13. #13
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,958
    Thank Post
    248
    Thanked 49 Times in 45 Posts
    Blog Entries
    2
    Rep Power
    46

    Re: Computer Startup Scripts

    Well yes I agree, it works at logon so why bother doing it at machine startup - but that's the question.

    As a matter of fact i'm having the same problem with my old script that has always worked previously - don't know if a GPO setting has blocked it, but i've run the script visibly, put pauses in it, and it all seems to execute properly, but as Spot is saying - the frelling printers don't get attached!

    I've just re-imaged too, and migrated to 2003 server - migrating to a new box, leaving the old box as print server.
    The script is run when the user has logged in, but as I said, running the script visible it seems to be running fine without errors. There is a GPO setting to force the script to run before the user logs in as I recall, which previously wouldn't work for me from my 2000 server - maybe try that Spot.

  14. #14
    Spot's Avatar
    Join Date
    Aug 2005
    Location
    Corby, Northants
    Posts
    8
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Computer Startup Scripts

    Ta very much for all the suggestions. I'll be doing more testing on Monday.

    I'm not really to fussed which way it works - as long as it works!

    Another one to chuck into the pot - for some reason I have one shared printer that refuses to go away. I need to have more of a look at but, briefly, this is the story so far...

    Created a RIS image for a new Dell PC. Edited the .sif file to include a printer. Applied the RIS image to a pile of new PCs. Set up a new default user profile on one of the newly "rissed" PCs. Any computers this user profile logs on to include the printer from the newly "rissed" PCs.

    I'm sure I've tried deleting this printer in a logon script, but it still seems to be there!

    I still need to investigate this further - hopefully should get a fix tomorrow and let you all know.

    Once again thanks for the suggestions so far - I was running out of walls to bang my head against...

  15. #15
    StewartKnight's Avatar
    Join Date
    Jun 2005
    Posts
    1,587
    Thank Post
    2
    Thanked 27 Times in 21 Posts
    Rep Power
    30

    Re: Computer Startup Scripts

    for what it's worth, this is my logon script:

    Dim oNetwork, sPrintPath
    Set oNetwork = CreateObject("WScript.Network")

    sPrintPath ="\\10.102.28.7\Room16"
    oNetwork.AddWindowsPrinterConnection sPrintPath
    oNetwork.SetDefaultPrinter sPrintPath


    WScript.Quit



    you can take out the SetDefaultPrinter for the 2nd printer

    the printer server is 10.102.28.7, and the printer name is shared as "Room16"

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. [MS Office - 2003] Outlook 2003 Startup wizard
    By Jake in forum Office Software
    Replies: 5
    Last Post: 1st May 2008, 09:52 AM
  2. RM CC3 Startup Script
    By randle in forum Windows
    Replies: 4
    Last Post: 30th July 2007, 02:56 PM
  3. Dreamweaver 8 startup Error
    By BKGarry in forum Educational Software
    Replies: 9
    Last Post: 26th June 2007, 01:33 PM
  4. 10min startup c/o whiteboard
    By Midget in forum Hardware
    Replies: 8
    Last Post: 30th November 2006, 06:29 PM
  5. IE6 trys to run an ISP setup on startup
    By pmassingham in forum Windows
    Replies: 1
    Last Post: 23rd March 2006, 10:20 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •