Jump to content
Sign in to follow this  

SW Hide with ShellExecute?

Recommended Posts


I'm trying to get some code working with ShellExecute. I would like the Window to execute hidden, but it does not seem to be working when I set the SW_HIDE flag. Any help is much appreciated. Code below:

Local $tmp = "C:\Temp"
Local $msi = $tmp & '\AdobeFlash.msi'

If Not FileExists($tmp) = 1 Then DirCreate($tmp)

InetGet("http://download.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_11_plugin.msi", $msi, 0, 0)

$afEXE = ShellExecute("AdobeFlash.msi", "", $tmp, "open", @SW_HIDE)

$run = ControlClick("Adobe Flash Player 11 Plugin - InstallShield Wizard", "", 1669)
Until $run = 1

$finish = ControlClick("Adobe Flash Player 11 Plugin - InstallShield Wizard", "", 1653)
Until $finish = 1



Share this post

Link to post
Share on other sites

Silent install. Which with more tinkering, I thought to myself... it's an MSI! Use the no UI switch and execute via MSIEXEC rather than just the MSI. Which seems to be working, but I would like to know if I am doing the code correct for say an EXE installer where this isn't an option.

Share this post

Link to post
Share on other sites

does this work?

run ( $temp & " /s")

if not, someone more familary with silent installs will be around shortly :)

Edited 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.

Share this post

Link to post
Share on other sites

Since it is an msi, I would suggest:

ShellExecuteWait("msiexec.exe", '/i "AdobeFlash.msi" /qn')

√-1 2^3 ∑ π, and it was delicious!

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

Sign in to follow this  

  • Similar Content

    • e45678mail
      By e45678mail
      I have some question about how to enable the test mode via "Run" or "shellexecute" of command,
      was to tried :
      Run("bcdedit.exe /-set testsinging on", "C:\Windows\System32")
      shellexecute("bcdedit.exe /-set testsinging on", "C:\Windows\System32")
      since this command must to run through administrator competence,
      have any method can accomplish it?
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
      Thank you,
    • Miloud
      By Miloud
      How to get the result of the command?
      My code :
      Local $iRc = ShellExecute ( "G:\ffmpeg\bin\ffmpeg.exe" , "-version" , "G:\ffmpeg\bin\") ProcessWaitClose($iRc) $Message = StdoutRead($iRc)
    • breakbadsp
      By breakbadsp
      I want to run a python script from autoit. 
      I know we can do this with shellexecute or run , but this python script takes 3 cmd line arguments.
      How to pass them from autoit script?
      I tried many ways.
      Following solution also not working 
      RunWait( 'fullpath\Python.exe Scriptpath\ReadLog.py  -f "file.log" -k "key" -e "errMsg" ') Found solution:
      RunWait( 'fullpath\Python.exe ReadLog.py -f "file.log" -k "key" -e "errMsg" ', 'Working_directory_path')  
      PFB description:
    • Mag91
      By Mag91
      Hey Community,
      cause im too new in the Auto it world i will try it with the your help. hopefully.
      I woud like to know how i can handle my Problem.
      I have a Excel Data with 362 random numbers.
      For Example:
      1166642335374 1172899897343
      this numbers are a part of the filepath ...example
      as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
      This is my first question. How can i handle this to make it Shell execute.
      Second question:
      If i am in the path.
      For Example:
      the code shoud search for specific PDF Files.
      They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
      the first 15 letters are always the same
      when he found this data he has to copy it on a Folder on the Desktop.
      (There can also be 2 or 3 pdfs in one Folder with this letters)
      Please give me some help :-)

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.