Windows 10: How do I prevent multiple .exes (eg notepad) from running?

Discus and support How do I prevent multiple .exes (eg notepad) from running? in Windows 10 Support to solve the problem; I sometimes accidentally run two copies of notepad. Sometimes, I don't spot them both in my taskbar. I wondered if there was a way to alert me that I'm... Discussion in 'Windows 10 Support' started by W10User123, Oct 9, 2016.

  1. How do I prevent multiple .exes (eg notepad) from running?


    I sometimes accidentally run two copies of notepad. Sometimes, I don't spot them both in my taskbar. I wondered if there was a way to alert me that I'm attempting to run the same .exe, if I already have it open?

    For example, on my desktop I have a notepad file. I'll run that, but sometime later, I'll double click on it again, forgetting that I've already got the same file open in notepad for editing, because it's been minimised, and I don't check the taskbar to see if it's there. Thanks for any comments.

    :)
     
    W10User123, Oct 9, 2016
    #1

  2. How can I prevent Windows 10 from opening multiple instances of the same .txt file in Notepad?

    How can I prevent Windows 10 from opening multiple instances of the same .txt file in Notepad? If this is by design, it's non-productive and inefficient for several reasons.

    I would like to know if there's a workaround to disable this or script it to not happen.
     
    InfoSeekerSD, Oct 9, 2016
    #2
  3. Notepad title

    When I use Notepad to compose a letter, how do I prevent the title from printing?
     
    Trinity1969, Oct 9, 2016
    #3
  4. dalchina New Member

    How do I prevent multiple .exes (eg notepad) from running?

    Hi, you could, if you wished, write a small script that launches Notepad from a shortcut

    The sequence would be

    If Notepad.exe already exists
    Ask if you wish to continue
    If yes, open Notepad
    else exit

    Quite easy in Autohotkey for example (free).
     
    dalchina, Oct 9, 2016
    #4
  5. BunnyJ New Member
    I just did a quick Google search and this is what I found:
    How to check if a process is running via a batch script
    windows - How to check if a process is running via a batch script - Stack Overflow

    And here's the code that's posted that looks interesting and it's set up for Notepad. So there might not be much adjustments required to it.
    Note: It's the second answer in the thread.. I'll check it out ASAP.

    Code:
    PHP Code: tasklist /FI "IMAGENAME eq notepad.exe" /FO CSV > search.log

    FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end

    start notepad.exe

    :end

    del search.log
     
    BunnyJ, Oct 9, 2016
    #5
  6. BunnyJ New Member
    Oh well.. that may not cut it.. I'll do some coding and see what I can come up with. I might have found a solution but it's going to take a bit of testing. With luck I'll have some solid results today.
     
    BunnyJ, Oct 9, 2016
    #6
  7. dalchina New Member
    Hi, here you are.. just install Autohotkey, and run the ahk script.

    Notepad.zip

    or simply run the exe file.

    As you have the AHK file you can edit that as you wish. Install Autohotkey and you can compile it with 1 click.
     
    dalchina, Oct 9, 2016
    #7
  8. BunnyJ New Member

    How do I prevent multiple .exes (eg notepad) from running?

    Nice.. that's better than the code I was playing with for certain.
    Jeff
     
    BunnyJ, Oct 9, 2016
    #8
  9. Thank you, that's much appreciated. I have marked this thread as solved.
     
    W10User123, Apr 4, 2018
    #9
Thema:

How do I prevent multiple .exes (eg notepad) from running?

Loading...
  1. How do I prevent multiple .exes (eg notepad) from running? - Similar Threads - prevent multiple exes

  2. How do i run a program with spaces in it's name eg: my program.exe from a batch file?

    in Windows 10 Gaming
    How do i run a program with spaces in it's name eg: my program.exe from a batch file?: When I run the following batch filecd "C:\Program Files x86\FSTramp" start FSTramp for MSFS11.exeWIN11 returns "...cannot find 'FSTramp'If I change the file tocd "C:\Program Files x86\FSTramp" start "FSTramp for MSFS11.exe"the Command window shows that the directory has...
  3. How do i run a program with spaces in it's name eg: my program.exe from a batch file?

    in Windows 10 Software and Apps
    How do i run a program with spaces in it's name eg: my program.exe from a batch file?: When I run the following batch filecd "C:\Program Files x86\FSTramp" start FSTramp for MSFS11.exeWIN11 returns "...cannot find 'FSTramp'If I change the file tocd "C:\Program Files x86\FSTramp" start "FSTramp for MSFS11.exe"the Command window shows that the directory has...
  4. How to prevent Microsoft To Do,Sticky notes and notepad from self minimizing?

    in Windows 10 Gaming
    How to prevent Microsoft To Do,Sticky notes and notepad from self minimizing?: I am in trouble! I use Microsoft To Do & sticky notes for my task management but when I switch between tabs, They are automatically minimized but I need that they will fix in my monitor until I minimize them....
  5. How to prevent Microsoft To Do,Sticky notes and notepad from self minimizing?

    in Windows 10 Software and Apps
    How to prevent Microsoft To Do,Sticky notes and notepad from self minimizing?: I am in trouble! I use Microsoft To Do & sticky notes for my task management but when I switch between tabs, They are automatically minimized but I need that they will fix in my monitor until I minimize them....
  6. Error "ucrtbase.dll was not found" preventing multiple programs from running.

    in Windows 10 BSOD Crashes and Debugging
    Error "ucrtbase.dll was not found" preventing multiple programs from running.: Multiple programs do not work because of an error "the code execution cannot proceed because c:\windows\system32\ucrtbase.dll was not found". I've looked through the forums but none of the fixes work. I've tried redownloading the file in question but I am repeatedly denied...
  7. How do I prevent programs from running at startup?

    in Windows 10 Ask Insider
    How do I prevent programs from running at startup?: It seems some programs just want to start up no matter what. I have disabled them in Task Manager startup manager, deleted them from the startup folder ("shell:startup"), and deleted all of their task scheduler tasks, and they still start up. There are many programs like...
  8. How can I get W10 to remember the size of a window? Eg notepad

    in Windows 10 Support
    How can I get W10 to remember the size of a window? Eg notepad: (Windows version number = 1903) When I run notepad, I always have to maximise it, before I start using it. If I then close it, then reopen it, W10 'forgets' that I've set notepad to maximised, and I have to maximise it again. Of course, I have tried manually moving the size...
  9. How do I prevent Firefox from opening multiple processes in Windows 10?

    in Windows 10 Network and Sharing
    How do I prevent Firefox from opening multiple processes in Windows 10?: About half the time when I use Firefox, it opens multiple processes. These don’t show up on Task Manager; I find out only when trying to open Firefox again, having thought it was shut down. Following posts on the Microsoft boards, I’ve set browser.tabs.remote.autostart to...
  10. How do I Set Compatibility Mode on Multiple EXE files

    in Windows 10 Software and Apps
    How do I Set Compatibility Mode on Multiple EXE files: Any of you Windows 10 experts know how to set Compatibity Mode on MULTIPLE EXE files? 92738