pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 1 minute ago, orbs said: specifically, does your "login" script have something like this at its top: FileWriteLine($sLogFile, "Hi, i started!") Yes. It gives a messagebox everytime it starts. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 12 minutes ago, pranaynanda said: EDIT: I tried using CamStudio to record what exactly happens when there is no display. It was foolish of me to even try that as I soon learnt that screen recording applications need displays. Any alternative suggestions to do that? Any comments are welcome on that. Link to comment Share on other sites More sharing options...
orbs Posted June 15, 2016 Share Posted June 15, 2016 12 minutes ago, pranaynanda said: Yes. It gives a messagebox everytime it starts. and how do you see this messagebox in headless mode? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
orbs Posted June 15, 2016 Share Posted June 15, 2016 (edited) 13 minutes ago, pranaynanda said: ... screen recording applications need displays ... no they don't. they need a user session. they work when you leave your RDP session open. if you want to debug a headless session, then do some good logging. Edited June 15, 2016 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 32 minutes ago, orbs said: how do you see this messagebox in headless mode? I dont. 30 minutes ago, orbs said: no they don't. they need a user session. they work when you leave your RDP session open. if you want to debug a headless session, then do some good logging. I use remote desktop connection manager. This is what I did. I executed the batch. I started recording and then switched to another window. There was no recording except for a black screen. Link to comment Share on other sites More sharing options...
orbs Posted June 15, 2016 Share Posted June 15, 2016 Just now, pranaynanda said: 36 minutes ago, orbs said: how do you see this messagebox in headless mode? I dont. so how do you know the script was launched at all? look, sorry if i'm being petty, but it's a bit important to know which step cripples your script, so we are checking from the very beginning. and forget about screen recording, that won't give you any info relevant to headless mode. add some logging to the script at important checkpoints - when it starts, when it detects the window, when it detects the controls, when it operates on the controls, etc. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 (edited) 3 minutes ago, orbs said: 9 minutes ago, pranaynanda said: 44 minutes ago, orbs said: how do you see this messagebox in headless mode? I dont. so how do you know the script was launched at all? Good question. I don't. All I know is that launch works but login fails. 3 minutes ago, orbs said: look, sorry if i'm being petty... Actually, I'm feeling very grateful for you coming out and helping me. Edited June 15, 2016 by pranaynanda Link to comment Share on other sites More sharing options...
pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 (edited) @orbs I owe you man. Your idea about extensive logging worked. Turns out when you do not provide a display, the window cannot be found or activated. Any ideas on how to proceed with that? Edit: This is the log that was created in headless mode. Parameters were passed 4 Message was printed -1 window exists 1 window was activated 0 user name was entered 0 password was entered 0 servername was entered 0 login was pressed0 Edited June 16, 2016 by pranaynanda Link to comment Share on other sites More sharing options...
pranaynanda Posted June 15, 2016 Author Share Posted June 15, 2016 (edited) Is there something like Send() cannot find the text field when there is no display and Controlsend() can? Edited June 15, 2016 by pranaynanda Link to comment Share on other sites More sharing options...
argumentum Posted June 16, 2016 Share Posted June 16, 2016 On 6/15/2016 at 4:04 AM, pranaynanda said: Any comments are welcome on that. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 17, 2016 Author Share Posted June 17, 2016 (edited) @argumentum I don't need to control the RDP remotely or without a user session. On 6/15/2016 at 4:40 PM, pranaynanda said: This is the log that was created without display. Parameters were passed 4 Message was printed -1 window exists 1 window was activated 0 user name was entered 0 password was entered 0 servername was entered 0 login was pressed0 AutoIt is able to detect the window but not activate it. "Window exists" is WinExists() and "window was activated" is WinActivate(). I need a workaround on that. EDIT: Okay, I get it now what you are trying to say but I have virtual machines that aren't servers. Any thoughts on that? Edited June 17, 2016 by pranaynanda Link to comment Share on other sites More sharing options...
argumentum Posted June 17, 2016 Share Posted June 17, 2016 6 hours ago, pranaynanda said: EDIT: Okay, I get it now what you are trying to say but I have virtual machines that aren't servers. Any thoughts on that? Well, in a VM you may have to have a click, a mouse click, for a window to appear. It happens to me using CutePDF on a VM's console session and if I don't click somewhere, anywhere really, the window does not popup. So in my code I click my own GUI every second ( right next to a stop printing button ). Faking a user may get tricky sometimes. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 17, 2016 Author Share Posted June 17, 2016 @argumentum What I've understood is that the problem might not be with the code but with the RDP session options? Is that correct? And is that what you mean? Also, have you seen this? I tried some logging. What to infer from this? On 6/15/2016 at 4:40 PM, pranaynanda said: This is the log that was created in headless mode. Parameters were passed 4 Message was printed -1 window exists 1 window was activated 0 user name was entered 0 password was entered 0 servername was entered 0 login was pressed0 Also, this is the result that I got after trying to do as you said. Or maybe I did it wrong. Could you please guide through this? Link to comment Share on other sites More sharing options...
argumentum Posted June 17, 2016 Share Posted June 17, 2016 30 minutes ago, pranaynanda said: this is the result that I got after trying to do as you said. Or maybe I did it wrong. Could you please guide through this? if it's a server, all you need is to give yourself permission, you can google that. If it's a Win 7 SP1 and above, microzoft will not give you a chance to shadow the session, not even patching the DLLs/registry/etc., in that case use VNC/teamviewer/etc. . Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted June 19, 2016 Share Posted June 19, 2016 found this, http://www.networkautomation.com/urc/knowledgebase/running-interactive-tasks-in-minimized-remote-desktop-windows/4ecdf43e03470/ , it may help you Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 19, 2016 Author Share Posted June 19, 2016 @argumentum Thank you! I haven't tried it yet. I will but tomorrow. I wanna ask is that are you sure that this is the reason that AutoIt is able to detect that a window exists but not able to activate it? Link to comment Share on other sites More sharing options...
argumentum Posted June 20, 2016 Share Posted June 20, 2016 12 hours ago, pranaynanda said: I wanna ask is that are you sure that this is the reason that AutoIt is able to detect that a window exists but not able to activate it? nope, I have no idea of what you are against, but, it that does it, that was it. I'm quite sure that you'll find a way to get done what you need Einstein said that genius was 1% inspiration, 99% perspiration. I agree. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 20, 2016 Author Share Posted June 20, 2016 @argumentum didn't do the job man. still the same troubles. Link to comment Share on other sites More sharing options...
argumentum Posted June 20, 2016 Share Posted June 20, 2016 On 6/13/2016 at 5:19 AM, pranaynanda said: ... I have an AutoIt bot that we use to perform "performance tests" on our commercial application using TimerDiff(). ... if { what you have works but not while on a remote desktop. I assume that that is the case. Then if that is so, my contribution should bring about the expected result. } else { I misled you and please forgive my intrusion. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
pranaynanda Posted June 20, 2016 Author Share Posted June 20, 2016 @argumentum 2 minutes ago, argumentum said: what you have works but not while on a remote desktop. I assume that that is the case. Yeah. You are right except for on a minimized remote desktop. I also expected the results would be good. But they aren't. Any other ideas you may bring about? 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