TigerKnee Posted April 6, 2014 Share Posted April 6, 2014 Hi All Here is the Control info for the field I am working with I have the app open so my script is simple. Just ControlSend the username "Kiosk". I tried all three below to no avail. Can you guys tell me what I'm doing wrong? ControlSend("Autologon - Sysinternals", "", "[Edit1]", "Kiosk") ControlSend("Autologon - Sysinternals", "", "[CLASS:Edit; INSTANCE:1]", "Kiosk") ControlSend("Autologon - Sysinternals", "", "[CLASSNN:Edit1]", "Kiosk") Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 6, 2014 Share Posted April 6, 2014 Remove the square brackets from the first line, and that'll be all you need. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 Remove the square brackets from the first line, and that'll be all you need. Thank you for the quick response. Tried this ControlSend("Autologon - Sysinternals", "", "Edit1", "Kiosk") And nothing happens Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 6, 2014 Share Posted April 6, 2014 Hmm. Could be that program doesn't accept 'automated input'. Try the ControlSetText or Send functions instead of ControlSend. The Send function will be a bit tricky to get to work. You'll need to set the focus (manually or with the ControlFocus function) to get it to work as you expect. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 Hmm. Could be that program doesn't accept 'automated input'. Try the ControlSetText or Send functions instead of ControlSend. The Send function will be a bit tricky to get to work. You'll need to set the focus (manually or with the ControlFocus function) to get it to work as you expect. I actually got the Send to work but the problem was that the window had to be active... So you're telling me to make it active with ControlFocus then use Send? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 6, 2014 Share Posted April 6, 2014 If that field automatically becomes active when the program get focus, you can use the WinActivate function to activate the program. Might I also suggest to read thru the Help file, several times even, to become familiar with all the native AutoIt functions and the language itself. Please, only take that as a suggestion, not a hidden RTFM! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 6, 2014 Developers Share Posted April 6, 2014 This works fine but guess you need to run with #RequireAdmin #RequireAdmin ControlSend("Autologon - Sysinternals", "", "Edit1", "Kiosk") Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 If that field automatically becomes active when the program get focus, you can use the WinActivate function to activate the program. Might I also suggest to read thru the Help file, several times even, to become familiar with all the native AutoIt functions and the language itself. Please, only take that as a suggestion, not a hidden RTFM! Haha if you were going to RTFM me, you probably would've done it in the first post! I consider myself a 7.5/10 in batch files so I'm trying to learn this. Believe me when I told you that I have scoured the Help menu and Google before posting here. I'm still trying to get a handle on the language itself. Thank you for your patience! Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 This works fine but guess you need to run with #RequireAdmin #RequireAdmin ControlSend("Autologon - Sysinternals", "", "Edit1", "Kiosk") Jos #RequireAdmin worked! Thanks!!! (Help and Google did not mention this at all....) Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 Arggg... Now I can into another problem... "Administrator" is prepopulated in Username: field. ControlSend ADDS to this so instead of clearing the field, it adds to it making it "AdministratorKiosk".. How do I clear it first before ControlSending? Link to comment Share on other sites More sharing options...
Palestinian Posted April 6, 2014 Share Posted April 6, 2014 Try ControlSetText with "" to clear whatever is in there then put your username. Link to comment Share on other sites More sharing options...
TigerKnee Posted April 6, 2014 Author Share Posted April 6, 2014 Try ControlSetText with "" to clear whatever is in there then put your username. That did it. Cheers to everyone for all your help! Link to comment Share on other sites More sharing options...
JohnOne Posted April 6, 2014 Share Posted April 6, 2014 (Help and Google did not mention this at all....)It does, you cannot control an application which runs at a higher privilege than your own. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TigerKnee Posted April 7, 2014 Author Share Posted April 7, 2014 Well now I have another problem....(never seems to stop!!!) None of my ControlSetText commands are working now that I'm using RunAs The executable runs but none of the text is getting sent like Run was. Any ideas? #RequireAdmin RunAs("LocalAdminUserName", "", "LocalAdminPassword", 0, "C:\Install\AutoLogon\AutoLogon.exe /accepteula") Sleep(100) ControlSetText("Autologon - Sysinternals", "", "Edit1", "UserName") ControlSetText("Autologon - Sysinternals", "", "Edit2", "Domain") ControlSetText("Autologon - Sysinternals", "", "Edit3", "PaSsWoRd") ControlClick("Autologon - Sysinternals", "", "Button1", "") WinClose("Autologon - Sysinternals") I tried 0,1,2 and 4 on the RunAs to no avail. Thanks again in advanced for your patience! Link to comment Share on other sites More sharing options...
MotionFlex Posted April 8, 2014 Share Posted April 8, 2014 One, do you need to run "AutoLogin.exe" as an admin. Wouldn't it work just find as a normal user using "Run". You only need to run your script as admin with the #RequireAdmin. Secondly, are you sure, 100ms is enough time for the application to load? Maybe, by the time the program loads, it's time to close it. You might want to use: WinWait("Autologon - Sysinternals") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now