i need to run a batch file (or a cmd) from c# . my code is this simple:
Process.Start(@"C:\b.bat");
Process.Start(@"cmd.exe");
i have also tried Executing Batch File in C# , and many other sites but i do not think the problem is syntax related.
the error happens for either line above, which I have googled but not found a solution for my particular problem:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll Additional information: The specified executable is not a valid application for this OS platform.
the weird thing is that these codes will run no problem:
Process.Start(@"IExplore.exe");
Process.Start("notepad");
i am running visual studio 2012 and compiling for x86, but my OS is windows 7 64-bit ,not sure if it matters.everything else in the program runs fine.
any help would be greatly appreciated!