Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Multiple Instances

Status
Not open for further replies.

bhansen

IS-IT--Management
Mar 14, 2002
53
0
0
CA
Is there a way to prevent multiple instances of a program from running?

Example I have a custom database application that my users will occasionally minimize and open a second instance. This can cause some problems.

Any suggestions.

Thanks
 
is there's any authentication within the program, there's probably some way of programing it to only let them in once.

otherwise maybe you can write an encapsulating vbscript that can have a flag that can indicate if it's already running.

e.g.

icons runs vbscript
vbscript runs application
vbscript pauses whilst application open

pseudocode:

'start
look for flag.
if flag exists then
msg program open already
exit script
else
create flag
run program
... << program runing
<program closed vbscript continues>
del flag
end if


wscript.run has optional parameter
bWaitOnReturn. Optional. If bWaitOnReturn is not specified or FALSE, immediately returns to script execution rather than waiting for the process to end.

^^ this is theoretically possible. ===============
Security Forums
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top