I was getting 'jlink' is not recognized as an internal or external command
when trying to run a command from a batch file. The batch file runs fine on its own, from command prompt. I've checked the path to the application and can see it in the PATH setting.
However, I added echo %path%
to my batch file and the application doesnt appear in the output...
How I'm launching the bat file...
public bool Execute(string batchFile)
{
var processInfo = new ProcessStartInfo();
processInfo.WorkingDirectory = programmersPath;
processInfo.FileName = programmersPath + batchFile;
processInfo.RedirectStandardError = true;
processInfo.RedirectStandardOutput = true;
processInfo.UseShellExecute = false;
var process = Process.Start(processInfo);
My user PATH setting...
Batch file...
echo %path%
jlink
Last few lines from the path output... (i'm not pasting the whole thing but jlink is not there)
C:\Users\rober\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files (x86)\mingw-w64\i686\mingw32\bin
EDIT
I am writing a WinForms app and launching it from Visual Studio. I'm not doing anything with users/permissions. Visual studio is launched as my user, not as Admin.
when I run echo %path%
from cmd I can segger is in there.
I'm clearly missing something, I just can't see what.