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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
David Johnson, CD, MVPOwnerCommented:
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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SaxitalisAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.