This is a strange one.
I'm using the following code to show a message to a specific user, but apparently, when running the code the msg command is reported as not found.
For testing I've changed MSG to CALC and calc is starting.
I've added if(file.exist) command to run the processinfo only if the file is found but even during debug the code is skipping the processinfo as it can not find the file.
my issue is that the file does exist and working perfectly from command line.
any ides why the code can not find this specific command?
ProcessStartInfo SendMsgToUser = new ProcessStartInfo("MSG", " " + Environment.UserName + " /time:10 " + "OK");
SendMsgToUser.WindowStyle = ProcessWindowStyle.Hidden;
Process pSendMsgToUser = Process.Start(SendMsgToUser);
SendMsgToUser = null;