Preventing multi-program opening

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
surajv
Posts: 1
Joined: 19 Oct 2009 10:22

Preventing multi-program opening

#1 Post by surajv » 19 Oct 2009 10:32

I have a program which i would like only one session open at a time. I want to create a batch script which prevent any more of opening and prompt a message saying something like -'There is one open already'. Please can anyone help?

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

#2 Post by !k » 20 Oct 2009 01:57

Code: Select all

@echo off
tasklist |findstr /c:"My Prog.exe" &&(echo There is one open already &pause &exit /b)
start "" "My Prog.exe"

Post Reply