Jump to content

Recommended Posts

Posted (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 by gillesg
  • 4 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...