Jump to content

Checkbox Question


Recommended Posts

Hi everyone,

I have checked out the forums and went looking through the help files and saw various posts on doing things similar to this but I'm still having difficulties.

I'm trying to do an automated printer install through Windows XP and am having problems with this section of code:

; Add a local printer attached to this computer
WinWaitActive("Add Printer Wizard")
Send("!l")
If ControlCommand("Add Printer Wizard", "[CLASS:Button; TEXT:&Automatically detect and install my Plug and Play printer; INSTANCE:4]", "IsChecked", "") = 1 Then
    ControlCommand("Add Printer Wizard", "[CLASS:Button; TEXT:&Automatically detect and install my Plug and Play printer; INSTANCE:4]", "Uncheck", "")
EndIf
Sleep(1000)
Send("!a")
Send("!n")
Send("!c")
Send("s")
Send("!n")
Sleep(1000)

When it gets to the section where it asks you if it's a local or network printer, the control is always different, depending on what PC you are at.

Sometimes the checkbox is checked and other times it isn't checked. I'd love to just have a way that looks for the "Automatically detect my Plug and Play printer" check box and unchecks it only if it is checked. If it's already unchecked, the script (in it's current form) will check the box.

Basically, whatever it starts at (checked or unchecked) will be reversed with this piece of code so I'm looking for a way to make sure it stays unchecked no matter what.

Can anyone help with this please?

Thanks!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...