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
Mann D
NA
4
0
close cmd.exe in task manager from C# windows application
Jan 14 2010 12:03 AM
problem wiht cmd.exe
i have to terminate cmd.exe(from task manager process) from C# windows application. The cmd.exe is opened as i am running my example.bat file in background. but when i want to stop that running batch file i have to terminate cmd.exe in task manager.
so i wrote this code :
string
processName =
"cmd"
;
Process
[] processes =
Process
.GetProcessesByName(processName);
try
{
foreach
(
Process
process
in
processes)
{
process.Close();
}
}
catch
(
Exception
ez)
{
MessageBox
.Show(
" No Cmd open"
);
}
but not working.... any one having solution????????
p.Kill(); is closing cmd.exe Excellent
but at same time its throwing exception : Acees is Denied..
Reply
Answers (
1
)
to add executable file..
Connecting a window application to a search engine