So I was trying to write a quick Batch file but it only did half the code, so I switched it to PowerShell because I remembered a while back I was able to get it to work and turns out this did work.
My issue is essentially I have a handful of users I want to have access to this "it just closes a program and reopens". They're familiar with Batch files (which I couldn't get to reopen the program) but would not be used to using a PowerShell script and having to right click to run as PowerShell which I'm expecting will cause issues and many of the users to not use the script in the first place.
Is there either something I did wrong on the batch file for it not to reopen or is there a way to change the left click option on the PowerShell(currently left click opens the script in notepad; ideally it would just run as PowerShell on left click)
The code is the same for both PowerShell and CMD copied and pasted directly to.
taskkill /IM ADM.TrayApp.exe /F
Start-Process  "C:\Program Files (x86)\athenahealth, Inc\aNetDeviceManager\3.1.4.0\TrayApp\CoreModule\ADM.TrayApp.EXE"


Powershell/CMD issue

You cannot use PowerShell's Start-Process directly in a batch file - you'd have to call via powershell.exe, the Windows PowerShell CLI or pwsh, the PowerShell (Core) CLI).

However, as Stephan points out, cmd.exe's internal start command provides similar functionality, so its use should be sufficient in your case (as Stephan notes, some window title enclosed in "..." is needed as the first argument if the executable to launch is enclosed in "..." too; "" will do):
start "" "C:\Program Files (x86)\athenahealth, Inc\aNetDeviceManager\3.1.4.0\TrayApp\CoreModule\ADM.TrayApp.EXE"


It is possible to make PowerShell scripts execute by default when (double-)left-clicked from File Explorer or the desktop, but requires nontrivial setup on each machine:

See this answer.
The linked answer also describes an alternative technique of providing simple companion batch files whose sole purpose is to execute an associated PowerShell script.



