on-internet
← Community

Run .bat file from C#

Stack Overflow ·

i am facing a strange issue , i have a .bat file which contains a code for renaming a file , when i open the .bat file manually it does what it is written on it which is renaming a file , but when i try to open it programtically from C# , it doesnt do anything , it jsut open the file and do not compile what it is written into . i typed that code : Process.Start(@"file.bat"); I also knew if you typed the path into cmd and pressed enter it will open the file and compile it , so i wrote that : ProcessStartInfo psi3 = new ProcessStartInfo("cmd", "/c " + '"'+"D:\\my Work\\My Soft\\CA Delete\\CA Del

Comments

Sign in or sign up to comment and upvote.

No comments yet.