Jump to content

Recommended Posts

Posted
Hi

With the following line I read out a process ID based on the path.
$s_Path = StringReplace($serverdir & $absolutedir & $g_c_sServerEXE, "\", "\\")
    $g_sPID = ObjGet("winmgmts:").ExecQuery('SELECT ProcessID FROM Win32_Process WHERE ExecutablePath="' & $s_Path & '"', "WQL", 16).ItemIndex(0).ProcessID
 
If the process does not exist, I get an error message. Which means I have to check beforehand whether the process exists. Does somebody has any idea.
Posted
 
that would be too easy, you can just call up the application. However, there are situations where the same applications run under different paths. If you only want to stop one of them, you need the query using the path via winmgmts.
  • Developers
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...