Jump to content

set a process name in script


Recommended Posts

I know I can use _singleton to keep only 1 instance of a script running but if someone copies and renames the exe, then they can have more than 1 copy running as the new process gets the name from the exe. Is there a command that will set the process name so even if the exe name changes, the process name will remain the same?

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

  • Developers

I know I can use _singleton to keep only 1 instance of a script running but if someone copies and renames the exe, then they can have more than 1 copy running as the new process gets the name from the exe. Is there a command that will set the process name so even if the exe name changes, the process name will remain the same?

Have you tried this assumption about _Singleton() before posting the question?

Jos ;)

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

Have you tried this assumption about _Singleton() before posting the question?

Jos ;)

If yes - you must not use the exe-Name as Key, use a new GUID for each script, for example :evil:

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Have you tried this assumption about _Singleton() before posting the question?

Jos ;)

yes, I compiled my script, ran it, looked at the process name. Then I changed the exe, reran it and looked at the process name again and the process name matched the renamed exe.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

  • Developers

yes, I compiled my script, ran it, looked at the process name. Then I changed the exe, reran it and looked at the process name again and the process name matched the renamed exe.

Correct, but you are not able to run both scripts at the same time which is what you wanted....right?

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

wow, you know what they say about assumptions...

I checked the process names and since they changed, I assumed that singleton would be looking for a name match entered in the code such as

_Singleton("process.exe") so if the exe was renamed and the process name was changed, it would no longer match what singleton was looking for "renamed.exe<>process.exe"

I guess singleton is smarter than I thought.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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