Jump to content
Sign in to follow this  
daenney

Add Printer Wziard

Recommended Posts

daenney

Hey guys,

Since XP SP3 adding our printer over the commandline casues a bunch of issues: people can't print, some printjobs arrive and are printed, others never seem to arrive at our CUPS server etc.

The funky part, if using the Add Printer Wziard itself and then adding the printer with the corresponding inf file everything works like a charm.

Now U've created the following script which ran for the first three times and then just stopped working:

RunWait(@ComSpec & ' /c rundll32 printui.dll,PrintUIEntry /ii /f \\inter-actief.lokaal\dfs\deploy\software\drivers\Archibald\Archibald.inf')
WinWait("Add Printer Wizard")
WinWaitActive("Add Printer Wizard","Welcome to the Add Printer Wizard")
Send("!n")
WinWaitActive("Add Printer Wizard","Select the option that describes the printer you want to use:")
Send("!n")
WinWaitActive("Add Printer Wizard","Example: \\server\printer")
Send("{DOWN}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{DOWN}")
Send("http://print/printers/Archibald")
Send("!n")
WinWaitActive("Add Printer Wizard","Do you want to use this printer as the default printer?")
Send("!n")
WinWaitActive("Add Printer Wizard","To close this wizard, click Finish.")
Send("{ENTER}")

I even added a WinWait call to be sure the window actually exists but it seems to get past the first Welcome to the Add Printer Wizard @ random. I've run this script on 3 machines, as script and as compiled and on two I managed to install the printer twice in a row and then it stopped working, on the third it never completed the wizard in the first place.

I'm kinda baffled (and new) to AutoIt so I was wondering if there's anyone out there that can offer some help...

Share this post


Link to post
Share on other sites
Ruud0209

Not a solution but my approach would be to put in some msgboxes for debugging and put in some delays of 500 or 1000 msecs to make sure the OS can keep up with the script.

goodluck,

Ruud

Hey guys,

Since XP SP3 adding our printer over the commandline casues a bunch of issues: people can't print, some printjobs arrive and are printed, others never seem to arrive at our CUPS server etc.

The funky part, if using the Add Printer Wziard itself and then adding the printer with the corresponding inf file everything works like a charm.

Now U've created the following script which ran for the first three times and then just stopped working:

RunWait(@ComSpec & ' /c rundll32 printui.dll,PrintUIEntry /ii /f \\inter-actief.lokaal\dfs\deploy\software\drivers\Archibald\Archibald.inf')
WinWait("Add Printer Wizard")
WinWaitActive("Add Printer Wizard","Welcome to the Add Printer Wizard")
Send("!n")
WinWaitActive("Add Printer Wizard","Select the option that describes the printer you want to use:")
Send("!n")
WinWaitActive("Add Printer Wizard","Example: \\server\printer")
Send("{DOWN}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{DOWN}")
Send("http://print/printers/Archibald")
Send("!n")
WinWaitActive("Add Printer Wizard","Do you want to use this printer as the default printer?")
Send("!n")
WinWaitActive("Add Printer Wizard","To close this wizard, click Finish.")
Send("{ENTER}")

I even added a WinWait call to be sure the window actually exists but it seems to get past the first Welcome to the Add Printer Wizard @ random. I've run this script on 3 machines, as script and as compiled and on two I managed to install the printer twice in a row and then it stopped working, on the third it never completed the wizard in the first place.

I'm kinda baffled (and new) to AutoIt so I was wondering if there's anyone out there that can offer some help...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×