Iraj Posted March 1, 2022 Posted March 1, 2022 Hello Team, Greetings! Is there any way to run any 3rd party application silently in background without the GUI getting in the front ? I was implementing angry-ip scanner with autoit & wanted the angry-ip application to run in background quietly as I am copying its output to other file on completion. is there any way to achieve my query? Below is code I tried: $range = "192.168.0.1 192.168.0.255" ShellExecuteWait("C:\Windows\DDM\ipscan.exe","-f:range "&$iprange&" -q -o C:\temp\ScanResults.csv","","open",@SW_HIDE) Thanks!
Nine Posted March 1, 2022 Posted March 1, 2022 When I do not want to see a window but I don't want it to be minimized or hidden, I simply move the window outside screen like this : WinMove("Title or hWnd here", "", -2000, -2000) The good think with this approach is that you can easily access the window to read/write info to it... Skysnake 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Iraj Posted March 1, 2022 Author Posted March 1, 2022 32 minutes ago, Nine said: When I do not want to see a window but I don't want it to be minimized or hidden, I simply move the window outside screen like this : WinMove("Title or hWnd here", "", -2000, -2000) The good think with this approach is that you can easily access the window to read/write info to it... I can try this. Thanks!
ad777 Posted March 1, 2022 Posted March 1, 2022 @Iraj: $pid = "ipscan.exe" $range = "192.168.0.1 192.168.0.255" ShellExecute("C:\Windows\DDM\"&$pid,"-f:range "&$iprange&" -q -o C:\temp\ScanResults.csv","","open") Sleep(100) _SETPid($pid, @SW_HIDE) Func _SETPid($pid, $STATE) $wins = WinList() For $i = 1 To UBound($wins) - 1 If BitAND(WinGetState($wins[$i][1]), 8) And ProcessList($pid)[1][1] <> 0 Then WinSetState($wins[$i][1], "", $STATE) EndIf Next EndFunc ;==>_SETPid none
Iraj Posted March 2, 2022 Author Posted March 2, 2022 22 hours ago, Nine said: When I do not want to see a window but I don't want it to be minimized or hidden, I simply move the window outside screen like this : WinMove("Title or hWnd here", "", -2000, -2000) The good think with this approach is that you can easily access the window to read/write info to it... It didn’t work out. The window stayed on the screen until its task got completed
Iraj Posted March 2, 2022 Author Posted March 2, 2022 21 hours ago, ad777 said: @Iraj: $pid = "ipscan.exe" $range = "192.168.0.1 192.168.0.255" ShellExecute("C:\Windows\DDM\"&$pid,"-f:range "&$iprange&" -q -o C:\temp\ScanResults.csv","","open") Sleep(100) _SETPid($pid, @SW_HIDE) Func _SETPid($pid, $STATE) $wins = WinList() For $i = 1 To UBound($wins) - 1 If BitAND(WinGetState($wins[$i][1]), 8) And ProcessList($pid)[1][1] <> 0 Then WinSetState($wins[$i][1], "", $STATE) EndIf Next EndFunc ;==>_SETPid It didn’t workout either. The window stayed on until process got completed
Nine Posted March 2, 2022 Posted March 2, 2022 2 minutes ago, Iraj said: It didn’t work out. The window stayed on the screen until its task got completed You cannot use the ShellExecuteWait !!! You need to use Run (my preference) or ShellExecute. You should have add some error handling, you would have noticed that the WinMove was failing “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Alex-Maax Posted December 14, 2022 Posted December 14, 2022 Due to running any executable (including but not limited to AutoIT) app in background I am using the following trick. Create vbs file Quote Set ws = CreateObject("Wscript.Shell") ws.run "cmd /c C:\Windows\DDM\ipscan.exe input-param",vbhide and then run that vbs file instead of the exe file. Iraj 1
abberration Posted December 14, 2022 Posted December 14, 2022 $pid = "ipscan.exe" $range = "192.168.0.1 192.168.0.255" Run("C:\Windows\DDM\" & $pid & " -f:range " & $range & " -q -o C:\temp\ScanResults.csv", "", @SW_MINIMIZE) Easy MP3 | Software Installer | Password Manager
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