I am using Windows7 system and if I go to Command line and run the following command, it works fine.
C:\WINDOWS\System32\MSG [windowsusername] "Hello"
So, I thought of executing the same statement from a C# program and copied this code from Internet.
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = @" /C MSG Amit.Jain Hello";
process.StartInfo = startInfo;
When I run the above code, unfortunately nothing happens. Does anyone have any idea what is going wrong here?
Thanks in advance.