Jump to content

Get Process ID of the current autoit script


zzen11
 Share

Recommended Posts

I am writing a script that I need to make sure there is only one copy running at any time. So, at the starting, I want to close all the process with same name but itself.

Is there any way to get the process id of the current process?

I don't see any Macro for current process ID.

Thanks!

Z

Link to comment
Share on other sites

  • Developers

I am writing a script that I need to make sure there is only one copy running at any time. So, at the starting, I want to close all the process with same name but itself.

Is there any way to get the process id of the current process?

I don't see any Macro for current process ID.

Thanks!

Z

Look at _Singleton() in stead for making sure the script is run only once...

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.
  :)

Link to comment
Share on other sites

  • Moderators

Agreeing with Jdeb, _SingleTon() is the way to go... but ... To answer your question specifically @AutoItPID ... but PID's are unique per process running, even if there are multiples of the same executable, each will have it's own Process Identification number.

Edit:

Posted solution in the WRONG thread :)

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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