473,651 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checking if app is running already?

Good morning

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

Thank
Deasun
Jul 21 '05 #1
3 1570
Deasun <an*******@disc ussions.microso ft.com> wrote:
In vb.net how would one go about checking if the app is already running?
Need some pointers on this.


See http://www.pobox.com/~skeet/csharp/f...ation.instance

(Phrased in C# terms, but easily understandable anyway.)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
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:\Prog ram 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)
Jul 21 '05 #3
Deasun <an*******@disc ussions.microso ft.com> wrote:
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\CBSS E APPS - F-Scan"
Thanks

Heres what i tried: (VB Sorry :()

1]
Dim firstInstance As Boolean
Dim mut As New Mutex(False, "Local\\C:\Prog ram 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.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4890
by: Randy Wayne | last post by:
I use a program that imports into Excel that requires that the workbook is closed prior to the import. How do you check to see if an Excel workbook is open, and then close the workbook? How do you then look to see if Excel is still running and then close it (Excel.exe)? I already know how to open an instance of Excel, use it, and then close it,
5
1770
by: kd | last post by:
Hi All, If the name of a process is known, is it possible to check whether it is in execution? What I did was to fetch all the processes running on the system using Process.GetProcesses() and traverse through the array looking for the Process name. Is there a shortcut or easier way to accomplish this?
3
315
by: Deasun | last post by:
Good morning In vb.net how would one go about checking if the app is already running Need some pointers on this Thank Deasun
7
1792
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception if the web site is not running. Is there any easy method of doing the same. I do *not* want to use IP to ping and check the server. Thanks pradeep_tp
5
3209
by: plmanikandan | last post by:
Hi, I am having a exe application which will be triggered by a external program.I need to check whether the exe is already running or not.If the exe is runing i need to discard the external program request.Is there any function available in c to check whether exe is running or not Regards,
16
3514
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of instructions which can sure be optimized away is the check for the break condition, at least within the time where it is known that the loop will not reach it. Any idea how to write such a loop? e.g.
2
3428
by: D & J G | last post by:
Bit of a newbie question.. Is there a VB6 way of telling what is already running? E.g. if a VB6 program has been minimized and selected again, the minimized one maximizes, instead of having the same thing running twice simultaneously. TIA Don
125
6542
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this problem. http://www.jilp.org/vol9/v9paper10.pdf Specifically, they measured the overhead of a bounds
1
2003
by: geetamadhavi | last post by:
Hi All, I have developed a php applciaiton where a new window is opening on checking the whether valid user orntot how to make that in same window after checking i have die(' not valid user ' ); i even tried with echo also how to solve this the message should come under in the same window only see my code it is program ---- <?php // Connects to your Database mysql_connect('localhost', 'root', 'epara') or die(mysql_error());
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.