Sign in to follow this  
Followers 0
kaotkbliss

set a process name in script

8 posts in this topic

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!

Share this post


Link to post
Share on other sites



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 ;)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0