Create specified delay before program will open after it was killed using C#

Hello Experts,

I am remotely killing Internet explorer with the following code in a C# APP:

System.Diagnostics.Process.Start("taskkill", "/S ComputerName /Im iexplore.exe");

This works great...

Now I would like to specify a delay before Internet Explorer can be opened back up after the taskkill (shown above).

In Other words I want to remotely...

1. Close IE browser window on remote computer with code shown above - this works fine
2. Specify a delay, say 30 minutes, before IE can open back up no matter how many times the icon is clicked by user.

Does anyone know how to do this?

Who is Participating?
David Johnson, CD, MVPConnect With a Mentor OwnerCommented:
your iekiller program will have to keep running:


kill internet explorer
// 30 minutes is 1800 seconds
for (counter=0; counter < 1800; counter ++){
   sleep 1 second
    if (tasklkist /f  iexplore .exe == true) {
// kill iexplorer
System.Diagnostics.Process.Start("taskkill", "/S ComputerName /Im iexplore.exe");
// optional
popup("Internet Explorer is currently disabled")
} // end of iekill 
} // end of delay

Open in new window

Jacques Bourgeois (James Burger)PresidentCommented:
It's a very bad idea, because a lot of other programs might not work correctly if Internet Explorer is disabled. A lot is dependant on the browser in todays applications.

This being said, the only way I can think of doing that would be to rename the IE executable file, that is usually "C:\Program Files\Internet Explorer\iexplore.exe".

I am not just sure that an application started by a regular user (non administrator) will have the right to do that, specially since you are in Remote.
SaxitalisAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.