Fractured Posted October 11, 2018 Share Posted October 11, 2018 (edited) I wrote a script to auto login to Macola. I have to run a .bat, send the keys to the cmd.exe window. Problem im having is the script will run the .bat.....but it seems the keys arent sent.....unless I already have the same .bat running!! So I have 2 instances of the batch file going.... The commented out lines are all the things ive tried...some just flash the batch on screen and then it closes....what is not commented out does work, but only if I run the batch file first then run the script...also the ######### is the password blocked out for obvious reasons! Any clues after searching the forums, help, goggle? Thanks in advance! #include <AutoItConstants.au3> ;Local $iPID = Run("C:\Users\cwright\Desktop\Frd-macolatest Macola.bat", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) Run("C:\Users\cwright\Desktop\Frd-macolatest Macola.bat", @DesktopCommonDir) ;WinWait("[Class:ConsoleWindowClass]", 3) ;ControlSend("C:\windows\system32\cmd.exe", "", "", "#############" & @CR) ;ControlSend("classname=ConsoleWindowClass", "", "", "#############" & @CRLF) WinActivate("[Class:ConsoleWindowClass]") ControlSend("C:\windows\system32\cmd.exe", "", "", "#############" & @CR, 1) ;StdInWrite($iPID, "###############" & @CRLF) Edited October 11, 2018 by Fractured Link to comment Share on other sites More sharing options...
Fractured Posted October 11, 2018 Author Share Posted October 11, 2018 NVM......forgot to winwait.... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 11, 2018 Moderators Share Posted October 11, 2018 @Fractured as a rule we do not deleted threads. We have all had that experience where we post a question and then 2 minutes later figure it out ourselves. If you post a detailed explanation of what you did to resolve the issue, it may help someone down the road looking at the same problem. spudw2k and Fractured 1 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Fractured Posted October 11, 2018 Author Share Posted October 11, 2018 @JLogan3o13 Ahhh...sounds good to me!! Explanation: 1-Found that I needed to add a WinWait command so that the batch had time to fully run and 2-I needed to set the $SEND_RAW (1) flag for ControlSend. Not sure why other than im learning Macola is not very friendly. Link to comment Share on other sites More sharing options...
caramen Posted October 12, 2018 Share Posted October 12, 2018 @Fractured erm... Are you french ? This issue is interesting me, could you PM me please ? I am asking myself about testing that with admin dos-consoles My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Fractured Posted October 12, 2018 Author Share Posted October 12, 2018 Nope..not french, hill billy german american...let m figure out how to p.m. and ill hit ya up. 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