Jump to content
Macro Express Forums

PowerShell script to ensure only one instance of MEP is running


Recommended Posts

I had a problem with a server where multiple administrators would try to log in resulting in multiple instance of MEP crashing into each other to do administrative tasks. I started to write a start-up macro that would conditionally abort launch if an instance was already running but MEP cannot 'see' processes running under other users. Since PowerShell can see processes for all users I wrote this little script that will launch MEP only if it's not already running regardless of user. Thought I'd post it here in case anyone might benefit from it.

if (-Not (Get-Process "MacExp" -ErrorAction SilentlyContinue | Where-Object {-not $_.HasExited }))
{
  & "C:\Program Files (x86)\Macro Express Pro\MacExp.exe"
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...