TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kishan gajjar
NA
62
0
How to create & write into Batch file using c#?
May 16 2009 11:55 AM
Hi... I want to create a new batch file on the pc & then i want to write some data in that batch file... suppose i want to make 1 batch file to restart the PC. so i need to create a new Batch file in the system and then i have to write in the batch file. and after writing i want to run it...so can u tell me how can i implement this??? i know the code how to restart pc... i have tried to write in the batch file using below code but not able to write in the batch file..so plz check the code and give me correct code. FileStream fs=new FileStream(Application.StartupPath+"//test.BAT",FileMode.Create); StreamWriter w=new StreamWriter(fs); w.WriteLine("shutdown.exe -r");
Reply
Answers (
6
)
Convert Bits to Byte[]?
How can i find parent directory from the given full path?