gillesg Posted November 10, 2018 Posted November 10, 2018 (edited) Hello, I am using for quite a time a piece "_ShellExecuteWithReducedPrivileges" from https://www.autoitscript.com/forum/topic/133698-_shellexecutewithreducedprivileges/ Coming back to run my Exe, it was not working any more. I have recompiled it recently with 3.3.14.5 autoit release. Does anyone has a clue, or can give me idea of why this piece of code is ot working anymore ? It seems the problem is located in the following code ; -- Vista/2008+ O/S. We're good to go! -- ; Shell Object (IShellDispatch5 on Vista+) $oShell=ObjCreate("Shell.Application") If Not IsObj($oShell) Then Return SetError(2,0,0) ; IShellDispatch5->IShellWindows ('ShellWindows Collection') object->FindWindow ; NULL, NULL, SWC_DESKTOP (0x08) [Vista+], Hwnd-Out (NULL), SWFO_NEEDDISPATCH (0x01) ; Returns IWebBrowser2 (InternetExplorer) object $oWebBrowser = $oShell.Windows.FindWindowSW(0,0,8,0,1) If Not IsObj($oWebBrowser) Then Return SetError(3,0,0) ;;;; This error is occuring here. What might have change or depend on the System ! ;;; ; IWebBrowser2->IShellFolderViewDual3 (ShellFolderView)->IShellDispatch5 (Explorer's Shell object) $oIShellDispatch= $oWebBrowser.Document.Application If Not IsObj($oIShellDispatch) Then Return SetError(4,0,0) ; Call Shell->ShellExecute. The return seems to always be a blank string, so nothing we can do about that $oIShellDispatch.ShellExecute($sPath,$sCmd,$sFolder,$sVerb,$iShowFlag) Thanks for any help or advice how to fix it Regards. Edited December 5, 2018 by gillesg
AdamUL Posted November 12, 2018 Posted November 12, 2018 What version of Windows are you running? Are you running 32-bit or 64-bit Windows? Is your script running 32-bit or 64-bit AutoIt? Adam
gillesg Posted December 5, 2018 Author Posted December 5, 2018 Sorry for the late reply, I found the issue. It was AV related. Code is working well
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