4 posts in this topic
SoundPlay sometimes(!) not working in a programme called by Run()
I am not 100% sure how to phrase my problem so I'm sorry if the issue has been addressed elsewhere. Here is my situation: I have added a file called MyStartup.exe (generated by AutoIt) to the list of programmes to launch on startup via the Windows registry on my laptop. As soon as it is running, this file will display a 3 minutes (tooltip) countdown and in the end call Run("Another.exe"). The latter is an AutoIt script, too. Among other things, it contains a few SoundPlay() commands, but for some reason, there is no sound coming at all! Strangely, however, when i manually run the MyStartup.exe and let it do its job, THEN the Another.exe plays sounds properly.
I can only guess what might be the matter here, since the same procedure (autostart) works fine on my other PC.
Any help would be greatly appreciated
[Solved] How do I launch an app as it's own parent process?
I have 3 processes that I am trying to work with:
The ControlCenter (Cannot Edit) and handles the other 2 processes. The ControlCenter will launch and close processes as requested by the user.
The Launcher (Can Edit) and launches an installer.
The Script (Can Edit) and automates the above installer.
My issue is, ControlCenter will terminate the Launcher and all of it's child processes. I need the script to continue running after the Launcher has been closed by the ControlCenter. How do I get the Launcher to launch the script in it's own parent process so it does not get terminated when the ControlCenter terminates the launcher and all child processes?
Sorry if this is confusing. I am terrible at explaining things. Autism can be a pain to deal with sometimes.
How to open multiple files in only one instance of the corresponding program?
Suppose MyProgram is a tabbed program, meaning that it allows for opening multiple files in the same instance.
I want to open File1, File2 and File3 in one instance of MyProgram from an AutoIT script. How can I do this?
I have read the AutoIT Help File about "ShellExecute" and "Run", but I have found nothing helpful.
Thanks for reading my question. Any answer would be very appreciated.
[SOLVED] Regex in 7 Zip Std Out (and error)
Perhaps someone would benefit off this. I made heavy use of the Help file example.
Only question I have here, is is there a better way to do the Regex for finding "error|ERROR|Error" in the source string? Thx
Example7zPwd() Func Example7zPwd() ;-- Local $iPID = Run(@ComSpec & " /c DIR Example.au3", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $iPID = Run(@ComSpec & " /c 7za t -pmasale myzip.zip ", "c:\files\testing", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $sOutput = "" Local $myError = 0 ConsoleWrite("$myError:" & $myError & @CRLF) While 1 $sOutput = StdoutRead($iPID) If @error Then ; Exit the loop if the process closes or StdoutRead returns an error. ExitLoop EndIf MsgBox($MB_SYSTEMMODAL, "Stdout Read:", $sOutput, 5) If StringRegExp($sOutput, '\b(error|ERROR|[Ee]rror)\b', 0) Then $myError = $myError + 1 ;ConsoleWrite("$sOutput: " & $sOutput & @CRLF) ConsoleWrite("$myError: " & $myError & @CRLF) WEnd While 1 $sOutput = StderrRead($iPID) If @error Then ; Exit the loop if the process closes or StderrRead returns an error. ExitLoop EndIf MsgBox($MB_SYSTEMMODAL, "Stderr Read:", $sOutput, 15) WEnd ConsoleWrite("$myError: " & $myError & @CRLF) If $myError > 0 Then MsgBox(64, "An Error Occurred", "The upgrade may be incomplete. An error occurred") EndIf If StringRegExp($sOutput, '\b(error|ERROR|[Ee]rror)\b', 0) Then Is the Regex here optimized?
Open Windows Shell Explorer
How can I start the Window SHell Explorer after closing it with this:
Run('TASKKILL /F /PID ' & ProcessExists('explorer.exe'))