jcrist90 Posted June 29, 2019 Author Share Posted June 29, 2019 On 6/22/2019 at 7:37 PM, mLipok said: Save your script to C drive ... Add FileExist('D:\....au3') and give as the result. I think you are using #RequireAdmin but the D drive is not mapped for admin..... Sorry fort long silence. I created a test script as you suggested, here it is: ConsoleWrite("FileExist = " & FileExists("D:\....au3") & @CRLF) Here is the result: >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\<myusername>\Documents\AU3\test.au3" FileExist = 1 >Exit code: 0 Time: 0.1028 So the file is there and AutoIT sees the file properly, it just ignores any content in it Link to comment Share on other sites More sharing options...
water Posted June 29, 2019 Share Posted June 29, 2019 Could you please add #RequireAdmin and try again? #RequireAdmin ConsoleWrite("FileExist = " & FileExists("D:\....au3") & @CRLF) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jcrist90 Posted June 29, 2019 Author Share Posted June 29, 2019 If I add this then Windows dialog pops out asking if I want to allow this script to make changes on my computer. After approval the program finishes but I don't see any information in the console, just "Exit code: 0" Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2019 Developers Share Posted June 29, 2019 22 minutes ago, jcrist90 said: After approval the program finishes but I don't see any information in the console, just "Exit code: 0" That's because the program is re-shelled with elevated rights thus not the same PID and not output will be shown by SciTE. I have been able to fix this in the latest version of Autoit3Wrapper which comes with the separate installer SciTE4AutoIt3. 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...
water Posted June 29, 2019 Share Posted June 29, 2019 As a workaround you could replace ConsoleWrite with FileWriteLine and then check the created file. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
TheDcoder Posted June 29, 2019 Share Posted June 29, 2019 (edited) 1 hour ago, Jos said: I have been able to fix this in the latest version of Autoit3Wrapper which comes with the separate installer SciTE4AutoIt3. Just curious about how this is implemented, how is the output relayed from the privileged process back to SciTE? Edited June 29, 2019 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2019 Developers Share Posted June 29, 2019 (edited) 2 hours ago, TheDcoder said: Just curious about how this is implemented, how is the output relayed from the privileged process back to SciTE? This is what it does: AutoIt3Wrapper checks whether the script needs to be elevated by checking for #RequireAdmin. When it does, it will check the current execution level with IsAdmin() and when at the same level it just shells the script and ends AutoIt3Wrapper. Else it will continue to the next step 3. It will perform "Func RestartReqAdmin()" which: It creates a MailSLot for receiving the output of the Elevated process. It creates a TempFile which will be use as a trigger for monitoring the end of the Elevated script. It creates a Temp au3 script that has #RequireAdmin and simple shells the original commandline used to by F5, replacing "/run" by "/RunAdmin" and at the end will delete the trigger file. It the Runs this created temp script and monitor's the MailBox for output till the trigger file is deleted. The shelled process in the previous step will now still prompt for UAC, and be re-shelled, but AutoIt3Wrapper wait for the trigger file, so keeps on waiting for the output which is now send to the MailSLot in stead of the Console. See "Func __ConsoleWrite($s)" for details. All clear? You can find the code in Autoit3Wrapper -> Func RestartReqAdmin() Jos ps: This works only one way as far as I remember, so only the elevated could send to the regular process's mailslot. Edited June 29, 2019 by Jos TheDcoder 1 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...
argumentum Posted June 29, 2019 Share Posted June 29, 2019 1 hour ago, Jos said: now send to the MailSLot in stead of the Console. _WinAPI_ChangeWindowMessageFilterEx may be of use to keep a 2 way interaction ?. 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...
TheDcoder Posted June 29, 2019 Share Posted June 29, 2019 4 hours ago, Jos said: All clear? Yes, thanks for the overview... quite an intricate approach Maybe it is possible to improve the communication using named pipes, but I understand that this is going to be more complex. Doesn't matter really as long as it gets the job done EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2019 Developers Share Posted June 29, 2019 (edited) 24 minutes ago, TheDcoder said: Maybe it is possible to improve the communication using named pipes, but I understand that this is going to be more complex. I would say these mailslot UDF posted by @trancexx are pretty advanced ...no?: Here you find some documentation for it: https://docs.microsoft.com/en-us/windows/desktop/ipc/mailslots Jos Edited June 29, 2019 by Jos Earthshine 1 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...
TheDcoder Posted June 29, 2019 Share Posted June 29, 2019 (edited) 16 minutes ago, Jos said: I would say these mailslot UDF posted by @trancexx are pretty advanced ...no?: Indeed, I agree. The reason why I said named pipes can improve is because as far as I understand, they are more suited for 1-to-1 communication and have fewer limitations than mail slots... not to mention that AutoIt's standard UDF library has functions for named pipes Edited June 29, 2019 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
argumentum Posted June 29, 2019 Share Posted June 29, 2019 5 hours ago, argumentum said: _WinAPI_ChangeWindowMessageFilterEx may be of use ok, that was not of much help.@Jos, I updated the ForkUDF ( even tho I don't feel it was ready, but is functional ), to show in the example file "Example_Fork_Events.au3" what I mean by using _WinAPI_ChangeWindowMessageFilterEx(). 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...
Developers Jos Posted June 29, 2019 Developers Share Posted June 29, 2019 I checked it briefly but believe that function is used for regular windows messages, not MailSLot. Let's bring this topic back on track and take this discussion into another thread when it needs further discussion, but for me is the trigger file fine for the moment. Jos argumentum 1 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...
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