vargheseg Posted November 12, 2019 Share Posted November 12, 2019 I have following .au3 compiled into .exe. on Win 10 PC. I ran the .exe file I do not want the powershell command pane to show up. Though it comes, it goes right away. I have set the -option WindowStyle hidden. Any insights how it can be completely hidden #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=C:\PS\samples\t10.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $sCommand = 'PowerShell.exe -WindowStyle Hidden' $sCommand &= ' ; ' $sCommand &= 'Get-Process > C:\PS\samples\p1.txt' Run($sCommand) Link to comment Share on other sites More sharing options...
Danp2 Posted November 12, 2019 Share Posted November 12, 2019 The Run command supports and optional show_flag parameter. Try setting it to @SW_Hide. vargheseg 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 12, 2019 Share Posted November 12, 2019 This is what I use for launching Powershell scripts $sPowerShell = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell", "Path") $sArguments = @TempDir & "\EWS\SendMail.ps1" $iPIDps = Run($sPowerShell & ' -ExecutionPolicy ByPass -File "' & $sArguments & '"', "", @SW_HIDE, 2) If @error Then ConsoleWrite("Error encountered on Run" & @CRLF) ProcessWaitClose($iPIDps) $sOutRead = StdoutRead($iPIDps) Consolewrite("Results = " & $sOutRead & @CRLF) vargheseg and Subz 1 1 Link to comment Share on other sites More sharing options...
vargheseg Posted November 12, 2019 Author Share Posted November 12, 2019 this worked - Local $sCommand = 'PowerShell.exe' $sCommand &= ' ; ' $sCommand &= 'Get-Process > C:\GVsaamples\p1.txt' Run($sCommand, "" , @SW_HIDE ) Thanks for your quick response 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