2

Can batch or Windows cmd file create or release mutex, without custom exe?

Similar questions (like this) tell only to write custom c exe.

Can I work with mutex from bare batch script, or only with use a some Windows standard utils?

UPD

I do not need the single instance bat, I need to work with mutex to send the message to already exist parent-process with known mutex. Temp file is not an answer.

UPD 2

  1. Parent program have the mutex (I use the hMutex:=CreateMutex( nil, TRUE, 'VCSClient2r123r123refqwe' ); in program startups, to prevent the multiple instances of parent program.
  2. Parent program run svn.exe diff "some_modified_file" --diff-cmd "diff.bat" --force
  3. diff.bat should send some messages to parent program. Because mutex is already exist and mutex name are fixed, I want to use it to send info from diff.bat to parent process.
Community
  • 1
  • 1
Y.N
  • 4,989
  • 7
  • 34
  • 61
  • 1
    You might be able to do it [using PowerShell](http://learn-powershell.net/2014/09/30/using-mutexes-to-write-data-to-the-same-logfile-across-processes-with-powershell/). – rojo Sep 10 '15 at 12:02
  • u could definitely do it in PS, but in essence you'd be building a program (as a dynamic DLL) to do so. Which in some respects is same as developing a custom C program. Suggest downloading Winobj and see if the mutex shows up in the \GLOBAL?? namespace. (Some items in the \GLOBAL?? name space are accessible by Win32 command line programs - if they're written to allow it.) If it does appear u might be able to find a command to determine if the mutex exists or not. But u wouldn't know if it's set/reset. On my system named mutexes are in \BaseNamedObjects, but there are no aliases in \GLOBAL?? – Χpẘ Nov 18 '15 at 17:25

0 Answers0