Search found 5 matches
- 20 Apr 2015 14:26
- Forum: DOS Batch Forum
- Topic: Preventing script collisions: allow only one instance per %1
- Replies: 11
- Views: 13323
Re: Preventing script collisions: allow only one instance pe
My final implementation is just to add the lockfile to the shortcuts that launch the daemons from the desktop (of startup folder). I implemented a log and lockfile external to the program: Shortcut target: C:\my_path\Databases\Code\database_daemon.bat name 2>&1 | wtee "..\logs\name_%date:/=...
- 19 Apr 2015 14:49
- Forum: DOS Batch Forum
- Topic: Preventing script collisions: allow only one instance per %1
- Replies: 11
- Views: 13323
Re: Preventing script collisions: allow only one instance pe
Thanks for your patience with me. I was thinking about testing the existence of the lock file and not fact that it is locked. I did not initially understand how Jed's script and how the lock disappears when the process locking it ends.
Thanks guys.
Mike
Thanks guys.
Mike
- 18 Apr 2015 00:06
- Forum: DOS Batch Forum
- Topic: Preventing script collisions: allow only one instance per %1
- Replies: 11
- Views: 13323
A cool implementation of a volatile lock
Setx does not allow setting in the volatile environment under HKCU, so I am doing it manually: @echo off C: chdir C:\where\I\am\going IF "%1"=="" ( Set "myvar=default" ) ELSE ( Set "myvar=%1" ) REM Create a key in the volatile area of the current user registry...
- 17 Apr 2015 14:30
- Forum: DOS Batch Forum
- Topic: Preventing script collisions: allow only one instance per %1
- Replies: 11
- Views: 13323
Re: Preventing script collisions: allow only one instance pe
Thanks for the reply. It looks like the process list does not show %1 and shows my scripts not my their bat name but by cmd.exe (even though I see the bat name in the GUI version). I was trying to avoid lock files because my IT department will do a patch requiring a reboot a couple times a month and...
- 16 Apr 2015 13:32
- Forum: DOS Batch Forum
- Topic: Preventing script collisions: allow only one instance per %1
- Replies: 11
- Views: 13323
Preventing script collisions: allow only one instance per %1
Edit: I found a neat implementation, see below. Does anyone know how to have a .bat scipt check if another version of itself (%0) is running with the same %1 I have several database deamons running and I've had mysterious data corruption issues which I was able to trace to an extra instance running...