Opened 10 years ago

Closed 9 years ago

#1807 closed Bug (Works For Me)

Success of some commands relies on last keyboard/mouse action

Reported by: Robert.L.Cull.ctr@… Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


If a mouseclick is the last action before certain commands run, the command will fail. If it were a keypress instead, however, it does not fail. Here's how I discovered this bug:
Made a simple script to run a specific program via the runas dos command with the smartcard switch. There was a message box immediately before the command would run. If I clicked OK, the command would appear to not run at all. If I pressed the ENTER key, however, it would work as it should. Here's something like it:

msgbox(0, 'asdf', 'click for fail, enter for win')
runwait(@comspec &' /c runas /smartcard notepad')

Turned out that the bug wasn't a result of the msgbox, but instead depended on the last action (keypress/mouseclick).

I've attached a small script with two demo functions. One demonstrates the operation proceeding successfully, and the other demonstrates the operation failing due to the bug.

Please be sure to read everything (instructions, etc.) carefully. Also, note that when it simulates either mouseclick or keypress, it will click where ever your mouse is at that time, and will send {PAUSE}. Don't let this mess things up if you have hotkeys assigned, etc.
Also, if the demo's aren't reproducing what they should, you might try to increase the sleep times throughout the script.

Attachments (1)

bugdemo.au3 (1.5 KB) - added by Robert.L.Cull.ctr@… 10 years ago.
bug demo functions

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Robert.L.Cull.ctr@…

bug demo functions

comment:1 follow-up: Changed 10 years ago by mvg

Not reproducible or not failing in any way, shape, or form on Xp(32.Pro.Sp3) while using "RunWait(@ComSpec & ' /k dir')"

comment:2 in reply to: ↑ 1 Changed 10 years ago by Robert.L.Cull.ctr@…

Replying to mvg:

Not reproducible or not failing in any way, shape, or form on Xp(32.Pro.Sp3) while using "RunWait(@ComSpec & ' /k dir')"

I'm also running XP 32 bit Pro Sp3.

I couldn't get it to happen with other commands, either. However, when you try it with "runas /smartcard ..." it DOES cause problems. Take a look at the sample code I attached- you don't need a smartcard reader to see how it fails. When you execute runas /smartcard without a smartcard, it will still try to find/read from a card reader device. When this bug occurs, the command will not even RUN. So seriously, take a look at what I attached.

There must be something special about runas /smartcard causing the error, which may exist in other commands as well.

comment:3 Changed 10 years ago by mvg

I figure something like that ...

The problem your running into here is: The need to proof that its AutoIt's fault and not the fault of RunAs. (with or without using /smartcard option.)

To figure that out more data is needed on what going on here.

(I currently have other things on my todo list. Maybe later.)
(It might also already be documented somewhere else.)

comment:4 Changed 10 years ago by Jpm

I am in the same situation as "mvg", I can't reproduce it.
My system does not have a smartcard reader and I am running Windows 7.
Is the smartcard reader mandatory?

comment:5 Changed 9 years ago by Jon

  • Resolution set to Works For Me
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.