Re: Computer Startup Scripts
Is the script trying to access information that doesn't exist? eg, logged in user info?
1 Attachment(s)
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!
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.
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?
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.
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!
Re: Computer Startup Scripts
That script will run at login though Stewart. :)
Re: Computer Startup Scripts
With Geoff there Stewart - I've always used my scripts at login through a GPO.
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!
Re: Computer Startup Scripts
Stewart - the thrust of the thread authors question is for a machine startup script, not a user logon script.
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!
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.
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...
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"