Re: Add Printer Startup Script

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Radu (Radu_at_discussions.microsoft.com)
Date: 01/15/05


Date: Sat, 15 Jan 2005 12:11:02 -0800

Hi,

Also, you might find useful to enable "Wait for network on startup" setting
on group policy. It will stay longer on the screen "Preparing network
connections", but I think it will do the job. I have the same script on my
network and it works just fine, without any problems.

"Ben" wrote:

> OK thanks I'll give it a try.
>
> Just one thing, wouldn't there HAVE to be a network connection to run the
> script, as its being run from group policy on a domian controller?
>
> Cheers
>
> Ben
>
> "Jan" <bril@ja.nt> wrote in message
> news:euyu2uh%23EHA.3336@TK2MSFTNGP11.phx.gbl...
> > At the time you run the script there is probably no network available.
> >
> > You can try WScript.sleep at the beginning of your script to give the
> > computer some time to start the network connections. I myself use 45000
> > milliseconds to wait before making any connections.
> >
> > "Ben" <bjblackmore@nospam.hotmail.com> schreef in bericht
> > news:eE1pHIb%23EHA.3416@TK2MSFTNGP09.phx.gbl...
> > > Hi,
> > >
> > > I'm using the following script to add a printer when a computer starts
> up.
> > > As I want the printer assigned to the computer not the users I've added
> > > this
> > > to the the computer configuration section of the GP, (under "Windows
> > > Settings>Startup/Shutdown"), rather than the user configuration section.
> > > However when you reboot the machine you get an error on start up saying
> > > Error at line 4, char 1, error can not find file specified. But if you
> > > login
> > > and run the script manually it works fine. How do I get the script
> working
> > > correctly?
> > >
> > > Cheers
> > >
> > > Ben
> > >
> > > -=Script=-
> > > Option Explicit
> > > Dim oNetwork
> > > Set oNetwork = CreateObject("WScript.Network")
> > > oNetwork.AddWindowsPrinterConnection "\\PRINTSERVER-2K\CUST-ACCOUNTS"
> > > oNetwork.AddWindowsPrinterConnection "\\PRINTSERVER-2K\CUST-SERVICES"
> > > oNetwork.SetDefaultPrinter "\\PRINTSERVER-2K\CUST-ACCOUNTS"
> > > Set oNetwork = Nothing
> > >
> > >
> > >
> >
> >
>
>
>



Relevant Pages

  • Re: Request help with simple network
    ... You do need to let DNS queries through the firewall, ... >> well as web browser connections. ... the machines behind the network to get them working (they just had the ... Below is my networking script, I run it *ONCE* on my gateway PC, whenever ...
    (alt.os.linux.redhat)
  • Re: ANN: NetPeeker 2.5
    ... >A powerful personal network tool. ... >Reveal network applications and their connections ... >Setup rules to block connections from inside and outside. ... script, popup killer may cause the page blank. ...
    (alt.computer.security)
  • Re: How many differences, categories?
    ... >> relocate the pattern by a process similar to the one we used to ... Network logic is counterintuitive. ... In theory the limit to the number of connections per node ... As Kauffman varied this connectivity parameter in his generic networks, ...
    (sci.cognitive)
  • Re: WMI Access from a Service
    ... > When trying to query WMI my script fails, although I cannot trap any kind ... > script also fails when accessing network settings using the windows shell ... > connections when a network connection to a specific network is connected ... > ' Check for Local Area Connections and status ...
    (microsoft.public.scripting.wsh)
  • Re: win XP Pro SP2 with latest RDP. Workgroup vs. domain
    ... I do not need to setup RDP port forwarding in the Belkin router. ... the firewall did have in the exceptions screen "Remote Desktop" ... think that the "Allow remote connections RDP" and/or having the firewall RDP ... for network connections. ...
    (microsoft.public.windowsxp.work_remotely)