checking if app is running already?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning

In vb.net how would one go about checking if the app is already running
Need some pointers on this

Thank
Deasun
 
Thanks for the reply
itried what you gave me, but it comes back with
The filename, directory name, or volume label syntax is incorrect
Same error message with all the code below

Any ideas to what is wrong? I am doing something wrong with the string value

Thank

Heres what i tried: (VB Sorry :(

1
Dim firstInstance As Boolea
Dim mut As New Mutex(False, "Local\\C:\Program Files\CBSSE Apps\IT Utilities\F-Scan\bin\F-Scan.exe", firstInstance
2
Dim firstInstance As Boolea
Dim mut As New Mutex(False, "Local\\F-Scan.exe", firstInstance
3
Dim firstInstance As Boolea
Dim mut As New Mutex(False, "F-Scan.exe", firstInstance)
 
Deasun said:
Thanks for the reply.
itried what you gave me, but it comes back with
The filename, directory name, or volume label syntax is incorrect.
Same error message with all the code below.

Any ideas to what is wrong? I am doing something wrong with the string value?

Yes. Firstly, you don't need the \\ - that's a C# escape sequence for
\. Secondly, you don't want to put the whole path to your app in the
string - just some unique name.

So, you might want:

"Local\CBSSE APPS - F-Scan"
Thanks

Heres what i tried: (VB Sorry :()

1]
Dim firstInstance As Boolean
Dim mut As New Mutex(False, "Local\\C:\Program Files\CBSSE Apps\IT
Utilities\F-Scan\bin\F-Scan.exe", firstInstance)
2]
Dim firstInstance As Boolean
Dim mut As New Mutex(False, "Local\\F-Scan.exe", firstInstance)
3]
Dim firstInstance As Boolean
Dim mut As New Mutex(False, "F-Scan.exe", firstInstance)

That last one should have worked, albeit not as a local mutex.
 
Back
Top