Page 1 of 1

Preventing multi-program opening

Posted: 19 Oct 2009 10:32
by surajv
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?

Posted: 20 Oct 2009 01:57
by !k

Code: Select all

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