Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
How to run a batch file from current directory?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
shijin
8y
385
1
Reply
I have written a code for adding a registry key on a batch file and executed in my project as follows.But i want to run it from current directory. Please help me to add current path and run the file from that.
System.Diagnostics.Process regadd = new System.Diagnostics.Process();
regadd.StartInfo.FileName = "C:\\Users\\win7\\Desktop\\Regkeyadd.bat";
regadd.StartInfo.RedirectStandardError = false;
regadd.StartInfo.RedirectStandardOutput = false;
regadd.StartInfo.UseShellExecute = true;
regadd.Start();
regadd.WaitForExit();
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Whatsapp Api
How to disable the MDIparent form when a child form is activ