Forum Discussion
Dmitry_Nikolaev
15 years agoStaff
Hi Benoit,
Here is the script demonstrating how to launch an application whose executable resides in the given folder:
Dim path
path = "C:\SomeFolder\"
Set foundFiles = aqFileSystem.FindFiles(path, "*.exe")
If Not foundFiles Is Nothing Then
Set WshShell = CreateObject("WScript.Shell")
' Launches the first .exe file found
WshShell.Exec(path + foundFiles.Item(0).Name)
Else
Log.Message "No exe files found"
End If
See the 'aqFileSystem.FindFiles' help topic for more information.
how do I check if an application is currently running or not?
Check whether its process exists by using the 'WaitProcess' method:
Set p = Sys.WaitProcess("notepad")
If p.Exists Then
Log.Message "Process exists"
Else
Log.Message("Process does not exist")
End If
Related Content
- 11 months agosanket2799
- 6 months agomrdwprice