vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Wed Jun 19, 2013 7:06 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Stop a pc from shutting down..
PostPosted: Tue Sep 25, 2007 1:18 pm 
(>^_^)>Kirby<(^_^<)

Joined: Sun Aug 20, 2006 4:00 pm
Posts: 754
Anyone have any clue how to stop a pc from shutting down..

So someone can't hit the shutdown button and have it turn off?

errr so if they hit the button it doesnt shut off.


Top
 Profile  
 
 Post subject: Abort a shutdown event in the windows virtual OS
PostPosted: Tue Sep 25, 2007 1:33 pm 
+7 Claymore of Slaying

Joined: Tue Aug 14, 2007 7:12 pm
Posts: 595

open notepad, click START / RUN / type notepad.



copy and paste this code in the file, and save as YourFile.bat - Remove .TXT extension or else it wont work...

Code:
@ECHO OFF
title anti-shutdown
color a
cls
echo Watch...
shutdown -s -t 15 -c "Bed Time..."
echo oh-no...
shutdown -a
del /s YourFile.bat




for visual basic 6,


i recall shell(shutdown -a) may work in vb6. , but if not then this fix is temporary and will work ok.

Code:
private sub form_load()
open app.path & "\Noshutdown.bat" for output as #1
print #1, "title anti-shutdown"
print #1, "color a"
print #1, "@ECHO OFF"
print #1, "echo watch..."
print #1, "shutdown -s -t 15 -c "Bed Time..."
print #1, "echo oh-no..."
print #1, "shutdown -a"  ' shutdown abort comes to the rescue :)
print #1, "exit"
print #1, "del /s Noshutdown.bat"
close #1

msgbox "Anti-Shutdown Script Has Been Created.",vbinformation + VbOkOnly,"Satisfied? :-\ "

end sub



Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 2:25 pm 
Slave to the BB

Joined: Sun May 27, 2007 6:54 am
Posts: 3110
Location: new york
and that helps how exactly? it only aborts the shutdown from within that script, a bat script will have no effect on someone clicking shutdown in the start menu or hitting ctl alt del.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 2:38 pm 
Site Admin

Joined: Fri Jul 14, 2006 4:00 pm
Posts: 11230
Location: Washington
Open up your case and pull out the connector to the power button.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 3:50 pm 
Hungry Zombie

Joined: Sat Jun 05, 1976 10:06 pm
Posts: 3179
Location: Auckland, New Zealand
I think CodeSeeker did a bit of a google and found this :P which if he read the question and understood the code he would know why it is irrelevant.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 5:50 pm 
(>^_^)>Kirby<(^_^<)

Joined: Sun Aug 20, 2006 4:00 pm
Posts: 754
lol
Quote:
Open up your case and pull out the connector to the power button.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 5:51 pm 
Arithmophobia

Joined: Thu Sep 20, 2007 5:54 pm
Posts: 328
Location: Los Angeles
a hammer to the hand of anyone trying to touch your shutdown button.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 12:31 am 
+3 Gloves of Agility

Joined: Fri Mar 23, 2007 1:15 pm
Posts: 164
i think there is an api however that aborts a shutdown, but it's hidden.

If you open office and write stuff , then shut down, it'll abort and say that there is still a office document open, meaning that when the WM_CLOSE (or whatever shutdown is) is sent to office, it must use an api to abort the shutdown and display that msgbox :/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 5:36 am 
+7 Claymore of Slaying

Joined: Tue Aug 14, 2007 7:12 pm
Posts: 595
Theirs an API , but considering bizzare sounded beginnerish i thought i'd start off simple. I did not google this, i had to learn batch script 2-3 years ago, automation was everything back then...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group