Windows Thread, Computer Startup Scripts in Technical; Another thing to consider here is a sleep timer, we had problems where the machine was so quick at installing ...
-
16th September 2005, 07:35 AM #16
- Rep Power
- 0
Re: Computer Startup Scripts
Another thing to consider here is a sleep timer, we had problems where the machine was so quick at installing the printer it exited the script before the setdefault action was completed.
Our script:
rem ** Next line must not be deleted **
SleepTime=15
Set WshNetwork = CreateObject("WScript.Network")
rem ** This will delete existing printers **
On Error Resume Next
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 1 to oPrinters.Count - 1 Step 2
WshNetwork.RemovePrinterConnection oPrinters.Item(i)
Next
WshNetwork.AddWindowsPrinterConnection "\\<servername>\StaffRoom-Laser"
rem ** Set Default Printer **
WScript.Sleep SleepTime*1000
WshNetwork.SetDefaultPrinter "\\<servername>\StaffRoom-Laser"
-
-
IDG Tech News
-
15th November 2005, 01:41 PM #17 Re: Computer Startup Scripts
Just come across this thread.
Unfortunately we do not have much in the way of VB Scripting skills here. Not for the want of trying. However we have found a way of setting default printers on each machine in a room. We have 6 computer suites all with their own printers, therefore we need to assign printers to 30ish PCs at a time. I have put together batch files run from a server that connect to the admin share on the PC and add a printer using the following (sample)
>RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /c\\%1 /n\\PRINT01\HPLJrm35
>IF NOT ERRORLEVEL 1 ECHO Printer HPLJrm35 installed on %1 >>printlog.txt
start /wait sc \\%1 stop spooler
start /wait sc \\%1 start spooler
%1 is the PC name e.g PC_3501, HPLJRm35 is the printer name.
This is run on all or one of the PCs in a room. We do also have rooms with two printers and simply add the second printer as another line.
When the user logs on "Printer.BAT" is run from the PC C:drive. to set the default printer (especially when there is more than 1 printer in a room)
This is as follows:
@echo off
@break off
Rem ...and make it the default
rundll32 printui.dll,PrintUIEntry /y /q /n\\PRINT01\HPLJRm35
start /wait sc \\%1 stop spooler
start /wait sc \\%1 start spooler
Hope this might be useful
-
-
15th November 2005, 01:51 PM #18 Re: Computer Startup Scripts
Thanks secman. What O/S's have you tried that on/do you have that working on?
-
-
17th November 2005, 12:06 AM #19 Re: Computer Startup Scripts

Originally Posted by
mark Thanks secman. What O/S's have you tried that on/do you have that working on?
It works on XP, with or without SP2 using W2K print server.
-
SHARE:
Similar Threads
-
By Jake in forum Office Software
Replies: 5
Last Post: 1st May 2008, 09:52 AM
-
By randle in forum Windows
Replies: 4
Last Post: 30th July 2007, 02:56 PM
-
By BKGarry in forum Educational Software
Replies: 9
Last Post: 26th June 2007, 01:33 PM
-
By Midget in forum Hardware
Replies: 8
Last Post: 30th November 2006, 07:29 PM
-
By pmassingham in forum Windows
Replies: 1
Last Post: 23rd March 2006, 11: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
-
Forum Rules