Modify

Opened 16 years ago

Closed 16 years ago

Last modified 10 years ago

#1346 closed Bug (No Bug)

Send doesn't work with windows opened under another user

Reported by: podws@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: send user Cc:

Description

Send doesn't work with windows opened under another user.

Following "send' doesn't do anything:

RunAs($AccountLocalName, $AccountLocalDomain, $AccountLocalPassword, 0, "notepad.exe")


WinWait("Notepad")
WinActivate("Notepad")
Send('!f')

Attachments (0)

Change History (5)

comment:1 by Valik, 16 years ago

Resolution: No Bug
Status: newclosed

I suggest you debug your code a bit further. There is a mistake in your code and once you correct that it will work just fine.

in reply to:  1 comment:2 by anonymous, 16 years ago

Replying to Valik:

I suggest you debug your code a bit further. There is a mistake in your code and once you correct that it will work just fine.

Dear Valik,

thanks for reply, the code is not complete, but I spend half hour with this issue, so I thing it has to be a bug:-)

AutoItSetOption("WinTitleMatchMode", 2)
$AccountLocalName = "Administrator"
$AccountLocalDomain = @ComputerName
$AccountLocalPassword = "Password123"

RunAs($AccountLocalName, $AccountLocalDomain, $AccountLocalPassword, 0, "notepad.exe")

WinWait("Notepad")
WinActivate("Notepad")
Send("!f")





comment:3 by Valik, 16 years ago

Okay, so this time you actually provided the crucially important "WinTitleMatchMode" line which fixes the mistake I found in your first attempt. Now that you've corrected that... it works just fine. I plugged in suitable account credentials for my Windows XP SP3 machine, Notepad popped up as the other user and the file menu appeared.

in reply to:  3 comment:4 by anonymous, 16 years ago

Replying to Valik:

Okay, so this time you actually provided the crucially important "WinTitleMatchMode" line which fixes the mistake I found in your first attempt. Now that you've corrected that... it works just fine. I plugged in suitable account credentials for my Windows XP SP3 machine, Notepad popped up as the other user and the file menu appeared.

Dear Valik,

I have used AutoIt for 8 years, so "WinTitleMatchMode" I use automatically, thas why I didn't put it in source code.:-)
Well, I didn't tested it on XP. I moved to Windows Vista Enterprise, SP1. Maybe problem will be something with UAC. I tried 3 computers with Microsoft Vista, the same result - it doesn't work.

comment:5 by stefanw, 10 years ago

Windows7 x64
AutoIt3_x64.exe V3.3.12.0

I just spent much time to find the "bug" in my code.
It was able to find the msg-window and it could extract text, but sending CTRL+C (copy msg to clipboard) or ENTER or mouse clicks to close it did not work.

IMHO the "bug" in Autoit (or just the thing missing) is an error or warning message to the console like "Can not send commands to process running as different user" or "as admin user".

At least there should be a big warning in "Send" (and similar) documentation.

Thank you :)

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.