Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to prevent windows xp from shutting down. i want to do this as im using my computer as a website server however when i go college my mum comes in my room and turns it off. please help

 

ps. i write vb .net so i would obviously need code in that language

 

BlahBlahBoring

Posted
I want to prevent windows xp from shutting down. i want to do this as im using my computer as a website server however when i go college my mum comes in my room and turns it off. please help

 

ps. i write vb .net so i would obviously need code in that language

 

BlahBlahBoring

 

 

Ill take a crack at it,

 

Theres a file in your C:\windows\system32 directory called shutdown.exe. Im pretty sure that this is the file that is run when you shut your computer down. Replace this file with a 'wrapper' file that you will create in visual studio that accepts a password. If the password is correct then run the shutdown file (which will be renamed)

 

However, this is probably not safe at all :P

  • Administrators
Posted

A windows shutdown is actually initiated by a call to either ExitWindows or ExitWindowsEx API calls. The shutdown.exe utility is simply a wrapper around these to allow the computer to be rebooted from a script or similar.

 

If you have a form running that simply setes e.cancel = true in it's closing event then this will prevent window closing. However it will not automatically stop other applications from being closed - it depends on the order windows tries to close them down.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

You might want to also disable the power button on the computer, a simple program of preventing windows from shutting down is not going to help if the switch is flipped.

 

If you have the big money, they do have power supplies that you can access over the net to turn on and off systems.

"Nobody knows what I do until I stop doing it."
  • *Experts*
Posted

Maybe just talk to your mum and say "Hey, I want my computer on 24/7 to act as a webserver." Communication is key.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Maybe just talk to your mum and say "Hey, I want my computer on 24/7 to act as a webserver." Communication is key.

 

-ner

 

lol thanks for all your help everybody, maybe ill just have to accept the fact that i have to find a way of hiding the power supply!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...