miragee Posted March 23, 2015 Share Posted March 23, 2015 Im running an script on a webserver and when im connect via rdp it works fine but when i try to run it w/o being connected to the rdp it do not work. The script do not bring the window to the front (it works on im connected) Is there anyway to bring it to the front, even im not connected to the server ? Link to comment Share on other sites More sharing options...
sherkas Posted March 23, 2015 Share Posted March 23, 2015 The last argument in iecreate is to take focus. (by default). I assume its more then that for you, which I would then say get the browsers handle and then do a winactivate on it to bring it back into focus. Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 Using the WinActivate() after the _IECreate() right ? Link to comment Share on other sites More sharing options...
jdelaney Posted March 23, 2015 Share Posted March 23, 2015 WinActivate(_IEPropertyGet($oIE,"HWND")) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 Isnt working, any ideas ? Link to comment Share on other sites More sharing options...
jdelaney Posted March 23, 2015 Share Posted March 23, 2015 (edited) You need to run your script on a desktop. If no one is logged in, it will run in the same environment that your services run in...session 0, which is the System User environment. Other than that, "Isn't working" won't help anyone...get specific. What's not working. Are you error handling, are you logging? How are you initializing the script? Edited March 23, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 So it's possible to force it to run as a specific user ? Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 It runs well, but i can't seem to put the windows focus if no one is connected to the desktop Link to comment Share on other sites More sharing options...
jdelaney Posted March 23, 2015 Share Posted March 23, 2015 (edited) Yep, because of this: https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F And yes, you can run the script as a specific user, but that won't address the link above... Edited March 23, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 So using an _IECreate(...) is no possible to focus the window if the user is not logged in ? or i can do it using the functions recommend on the link you gave to me ? Link to comment Share on other sites More sharing options...
jdelaney Posted March 23, 2015 Share Posted March 23, 2015 There is no need to focus to use the _IE functions. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
miragee Posted March 23, 2015 Author Share Posted March 23, 2015 I need to use it because im uploading a file and can't use only the _IE function to do it (or atleast i didnt find a way to put it working, page uses an ajax upload so i need to submit it manually). So when im connect ot the rdp it works fine and when i try to test that w/o being connect it do not work because the IE window isnt focused Link to comment Share on other sites More sharing options...
jdelaney Posted March 23, 2015 Share Posted March 23, 2015 You can do all that behind the desktop. Click the button to bring up the file explorer and interact with the file explorer window...keeping in mind the limitations of the link I posted. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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