Jump to content
iAmNewbe

Problem with Web Browser opening URL via ShellExecute

Recommended Posts

I created an application to catch keyboard programmed keys.  Some of the keys open URL's via ShellExecute and then they open in the default browser.

The problem I am having is that when the browser is opened in this manner 3rd party applications such as Logitech Setpoint for Logitech mouse and keyboards and programs like auto password form filling stop working with the browser.  In the mouse specific situation the Cruise Up and Cruise Down buttons, normally back and forward, do not work. If I open the browser manually via the browsers icon and then press the keyboard buttons to open the web page everything works normally.

I have two questions:

1:  Why does 

ShellExecute("http://www.autoitscript.com")

when the browser is not open and then is launched, via the above line, cause third party apps to not be able to interface with the browser?


2:  What is a better way to launch URL's if not via ShellExecute?


The application is NOT using #RequireAdmin and is not 64bit.

Share this post


Link to post
Share on other sites

I ended up changing the ShellExecute line to include the actual browser executable, this no longer opens the default browser and instead whatever executable I call directly but it fixes the issue with third party apps accessing the browser.

I do not understand why just entering the URL by itself without an executable causes this problem.

Share this post


Link to post
Share on other sites

Sorry, I can't answer your questions. However, you can open the link in your default browser by using _RunDos and windows URI:

#include <Process.au3>
_RunDos("start www.google.com")

Sometimes, you can use Windows URI to open URL(s) in specific browsers by:

;For Internet Explorer
_RunDos("start iexplore google.com ")
_RunDos("start iexplore google.com bing.com")

;For Firefox
_RunDos("start firefox google.com")
_RunDos("start firefox google.com bing.com")

;For Chrome with normal & incognito mode
_RunDos('start chrome google.com bing.com')
_RunDos('start chrome google.com bing.com google.com')
_RunDos('start chrome google.com bing.com --incognito "google.com"')
_RunDos('start chrome --new-window --incognito "google.com"')

I think this is just another way of ShellExecute, the difference is you type the whole dos command instead of filling them into parameters of ShellExecute function.

I haven't tried for Edge, since my computer is running Windows 7 🤣

Edited by LukeLe
edit URI for chrome browser

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By chenni037
      I need to save the execution result as a text file. Is there any solution?
      ShellExecute ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )    if  parameters have " > " can't Execute correctly, 
      Example 1:
      ShellExecute("diskspd.exe", "-b128K  -c64M f:\estfile.dat > test123.txt", "", "", @SW_MAXIMIZE)  ;Error
      ShellExecute("diskspd.exe", "-b128K  -c64M f:\estfile.dat", "", "", @SW_MAXIMIZE)                         ;OK
      Example 2:
      ShellExecute("help", "dir > helpdir.txt", "", "", @SW_MAXIMIZE)  ;Error
      ShellExecute("help", "dir", "", "", @SW_MAXIMIZE)                         ;OK
      T1.au3
    • By HariKara
      I have a script that seems to launch perfectly fine with IECreate, however, I want to launch the Browser and a specific URL with the RunAs command. I fairly new to AutoIT and wanted to know if someone can point me in the right direction.
      Local $surl = "http://somewebsite.com/DODA/admin/job.aspx"
      Local $oIE = _IECreate($sURL)
      The above launches the website correctly with the correct URL, however, I have tried the below and this fails to load and browser?
      #include <AutoItConstants.au3>
      ;========================
      $oSleep = "200"
      Local $surl = "http://somewebsite.com/DODA/admin/job.aspx"
      Local $oIE = RunAs($args("username"), $args("domain"), $args("logonpassword"), "", "C:\Program Files (x86)\Internet Explorer\iexplore.exe http://somewebsite.com/DODA/admin/job.aspx")
      _IELoadWait($oIE)
       
      I get the following error back?
      --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidDataType
      --> IE.au3 T3.0-2 Error from function _IEGetObjById, $_IESTATUS_InvalidDataType
      --> IE.au3 T3.0-2 Error from function _IEGetObjById, $_IESTATUS_InvalidDataType
    • By ambad4u
      Hello and Good Day to All!
      I am trying to install .NET 3.5 on Windows 10 x64bit via autoit (via ShellExecuteWait + PowerShell).
      If I run this line, it will runs without issues:
      ShellExecuteWait('PowerShell.exe', '-executionpolicy Bypass -File "' & @ScriptDir & '\OJP83BU523.ps1' & '"') "OJP83BU523.ps1" contains: DISM /Online /Enable-Feature /FeatureName:NetFX3 /All /Source:D:\Sources\sxs /LimitAccess
      However, since I won't know in advance the drive letter of the "sources" folder, I created a script to generate a PowerShell Script to give a correct path for it.
      With the modified script below, PowerShell only blinks and nothing happens
      ShellExecuteWait('PowerShell.exe', '-executionpolicy Bypass -File "' & @ScriptDir & '\' & $filename & '"') or
      ShellExecuteWait('PowerShell.exe', '-executionpolicy Bypass -File "' & $filename & '"')  
      I wish I know the difference with "$filename" and "\OJP83BU523.ps1" usage, as for me, it should be the same.
      Attached is my entire autoit script.
      any help is appreciated!, many thanks in advance!
      test.au3
    • By nacerbaaziz
      hello sirs
      please i want to use the WinHttp to get the google drive file title using the api
      i searched in the forom but i didn't found any Google drive api UDF
      for that i liked to ask you for that
      i had read the google drive api documentation but i couldn't do it
      please help me
      here is the api doc
      note i've got the apikey and i have the file id
      what i want is to get the title of the file (the file name)
      because i want to download the files from the google drive using the autoit
      please help me for that
      am sorry because i didn't gave you any example or what i tried but all what tried was  failed
      thanks in advance
×
×
  • Create New...