Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:36:55+00:00 2026-06-13T01:36:55+00:00

I have used solution of Mutex to disallow opening more than one instance of

  • 0

I have used solution of Mutex to disallow opening more than one instance of my application at the same time

but, when i use Switch User in windows and open another user, and try to open the application, it opened normally and can’t detect that it’s running on other account

how could i solve something like this and disallow opening the application among Logged in Windows User Accounts

i am using code like this

Dim onlyInstance As Boolean = False
_mutex = New Mutex(True, "Application Name", onlyInstance)
If Not onlyInstance Then
   MessageBox.Show("Application is already running.", "Error.")
   System.Diagnostics.Process.GetCurrentProcess.Kill()
   System.Diagnostics.Process.GetCurrentProcess.WaitForExit()
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:36:56+00:00Added an answer on June 13, 2026 at 1:36 am

    If you make your mutex global, then it will be visible to all users:

    mutexName = String.Format("Global\\{{{0}}}", "Application Name"); 
    

    From the documentation:

    A named system mutex can have two levels of visibility. If its name
    begins with the prefix “Global\”, the mutex is visible in all terminal
    server sessions. If its name begins with the prefix “Local\”, the
    mutex is visible only in the terminal server session where it was
    created. In that case, a separate mutex with the same name can exist
    in each of the other terminal server sessions on the server. If you do
    not specify a prefix when you create a named mutex, it takes the
    prefix “Local\”. Within a terminal server session, two mutexes whose
    names differ only by their prefixes are separate mutexes, and both are
    visible to all processes in the terminal server session. That is, the
    prefix names “Global\” and “Local\” describe the scope of the mutex
    name relative to terminal server sessions, not relative to processes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used the cURL solution to solve XSS but there is an issue
I used the mapping solution from this question to have a joined component. But
I have used the silverlight control in CRM 2011.It also published on form but
I have used a plugin that uses prototype js, it's working fine but the
I have used NSSets many times in my apps, but I have never created
I have used the SL business application template and added a new blank, empty
In my application i have used the UiViewController and able to push the other
I'm writing a query, and have used the solution in this thread and it
I have used this tutorial to make a website, but I would like that
I have taken over support of a VB .Net application that makes use of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.