Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus batch bios bsod crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard mouse network printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: Shutdown script for iexplore.exe in Win XP

Reply  
Thread Tools
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
15-Aug-2008, 05:57 AM #1
Solved: Shutdown script for iexplore.exe in Win XP
Hi!

I need a script that wel be activ wen you start iexplore.exe and close the proses after 1h,
I't shud only be acktiv for low previlider status not the admins.

i prefer c++ script becus i can alitel abaut it but eny ladvidge wel go finde if you tell me hau to youse it ^.^

Hears an link of an code i cod probobly rebild but im as an beginer dont understand haw i wod compilate or wear i wod put it to get it work
http://www.microsoft.com/technet/scr...6/hey0228.mspx
Thx for the help.
And sry for the bade english :-P
-Fabez-'s Avatar
Senior Member with 1,943 posts.
 
Join Date: Jul 2008
Location: Earth
Experience: General
18-Aug-2008, 10:03 AM #2
Just catch its handle and destroy the handle after the hour is up.
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
18-Aug-2008, 10:20 AM #3
Well how do i get it to work sry for beeing sotsh a nobb but vear do i put the code ? and do i compilate it and in that case VB or c++? :-P
*Ican probobly fidgur aut the code if i understod wear 2 handel it ^^
mt2002's Avatar
Computer Specs
Senior Member with 926 posts.
 
Join Date: Sep 2005
Location: 127.0.0.1
Experience: Advanced
18-Aug-2008, 03:41 PM #4
I would not use C++ for this. While it is possible, you will need to go through your system API. You stated that you are new to C++. If this is true, this may be to advanced for you.

Also, please do not confuse scripting with programming--they are very different from each other.
__________________
char c[3]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 02:19 AM #5
Tru, tru but i dont need that information wery mutsh nowing it wod be dificult in c++ i alredy nyue but can eny of you pleas actshualy anser my question like in wat landguidge the link is and how i youse it

exempel
its an **** code and you hawe to putt/compilate it hear (addres) to get it to work =S

Hope to get an anser this time

I still hawe hopes upp fore this site ^^
avisitor's Avatar
Computer Specs
Senior Member with 1,712 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced
19-Aug-2008, 08:32 AM #6
The link is WSH VBScript. It's an interpreted language, not compiled. It's not that it would be difficult in C++/C#/VB if you wrote a launcher that remembered its process ID and killed it if it's running after an hour.

Something like this in C#.NET 2008:

Code:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "iexplore.exe";
process.Start();
System.Threading.Thread.Sleep(3600000); //Sleep for one hour. Wake up and kill the process.
if (process.HasExited==false)
{
            process.Kill();
}
You would launch that instead of iexplore. It would launch IE, sleep for an hour, then kill IE, then terminate itself. You could add stuff about not killing IE for administrators, etc.

Doing it with a launcher is significantly better than doing it with WSH. If you do it with WSH, you have to constantly poll the process table to find if IE is running, then you have to cache the PID and the time. Then you have to wait for an hour, then you have to poll to see if it's running again and if it is, kill it. But in the mean time, you needed to constantly keep polling to see if it was closed and a new instance wasn't open. So, doing it that way is far more complicated. All that polling is nasty, anyway .
__________________
Austin

Please refresh, I edit my posts often.

Last edited by avisitor; 19-Aug-2008 at 08:38 AM..
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 09:34 AM #7
O my good your the best ewer xD im wery gratfull and imprest thx alot m8 i wel trye your code insted seams like al i need
Thx agen avisitor ^^
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 10:09 AM #8
Quote:
Originally Posted by avisitor View Post
The link is WSH VBScript. It's an interpreted language, not compiled. It's not that it would be difficult in C++/C#/VB if you wrote a launcher that remembered its process ID and killed it if it's running after an hour.

Something like this in C#.NET 2008:

Code:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "iexplore.exe";
process.Start();
System.Threading.Thread.Sleep(3600000); //Sleep for one hour. Wake up and kill the process.
if (process.HasExited==false)
{
            process.Kill();
}
You would launch that instead of iexplore. It would launch IE, sleep for an hour, then kill IE, then terminate itself. You could add stuff about not killing IE for administrators, etc.

Doing it with a launcher is significantly better than doing it with WSH. If you do it with WSH, you have to constantly poll the process table to find if IE is running, then you have to cache the PID and the time. Then you have to wait for an hour, then you have to poll to see if it's running again and if it is, kill it. But in the mean time, you needed to constantly keep polling to see if it was closed and a new instance wasn't open. So, doing it that way is far more complicated. All that polling is nasty, anyway .
Hmm i wonder wat im doing wrong meby a liberary mising?
Compiler: Default compiler
Building Makefile: "C:\****"
Executing make...
make.exe -f "C:\****\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/C++/devcpp15/Dev-Cpp/include"

main.cpp: In function `int main(int, char**)':

main.cpp:9: error: `System' was not declared in this scope
main.cpp:9: error: expected `;' before "process"
main.cpp:10: error: `process' was not declared in this scope

make.exe: *** [main.o] Error 1

Execution terminated



Meby its an exrealmy noobish question but i love an anser xD
Hope you hawe time avisitor ^^
mt2002's Avatar
Computer Specs
Senior Member with 926 posts.
 
Join Date: Sep 2005
Location: 127.0.0.1
Experience: Advanced
19-Aug-2008, 10:42 AM #9
The code posted is not C++, its C#. ie, it will not work with g++ or Dev C++ (or any C++ compiler actually)

I don't know C# so cannot help much with that...
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 10:47 AM #10
oki that cod be a problem but wen im locking 4 an c# compilator only c++ and VB is coming aut so i fidgurd it wod work =S

Thx enywey meby he gets back 2 this tred end fix it fore me hehe :-P
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 11:02 AM #11
oki I well trye those end se if i can fix it

avisitor's Avatar
Computer Specs
Senior Member with 1,712 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced
19-Aug-2008, 11:23 AM #12
You want Visual Studio C# Express Edition. You need to encode it in some methods as well, it's just a snippet.
Lostarin's Avatar
Computer Specs
Junior Member with 11 posts.
 
Join Date: Aug 2008
Experience: Beginner
19-Aug-2008, 03:31 PM #13
=s deddent realy understand wat i hawe to do to get the cod going but i vel tryge gett Visual Studio C# Express Edition and compilate it?

If somwan hawe time 2 craate the exe and post it and the sorce and witsh compilator and libarary you yoused i wood be wery gratefull ^^ in the meantime thx 4 all the ansers i only hope i wel lern somting fom them ^^
avisitor's Avatar
Computer Specs
Senior Member with 1,712 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced
19-Aug-2008, 10:56 PM #14
Fine I'll do it, but I'm not going to waste the time to test it. You can do that.
avisitor's Avatar
Computer Specs
Senior Member with 1,712 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced
19-Aug-2008, 11:19 PM #15
This does what you want: happy?

So you change the shortcuts for internet explorer to point to that application, then that launches IE, and kills it after an hour if you're not an Administrator. Change the code as necessary. Caveat emptor.
Attached Files
File Type: zip ietimeout.zip (52.2 KB, 52 views)
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:24 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.