February 25, 2021, 01:50:13 AM

Author Topic: [bb] Windows Shutdown by pexe [ 1+ years ago ]  (Read 442 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Windows Shutdown by pexe [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : Windows Shutdown
Author : pexe
Posted : 1+ years ago

Description : use:
-s to shutdown
-r to restart
-l to logoff
and you can set the time to the operation by using -t XX
XX = time in secs

tested with Windows XP Professional

Code :
Code: BlitzBasic
  1. Function DLLShutdown(parm$="-s -t 0")
  2. ExecFile SystemProperty("systemdir")+"shutdown.exe"+parm$
  3. End Function

Comments :

xlsior(Posted 1+ years ago)

 You probably should parse your environment variables first, since you can never count on windows being installed in c:windows... Many systems use c:winnt instead, and technically it doesn't even have to be on your C drive.

pexe(Posted 1+ years ago)

 it is only an example, you can custumize this code how you want..and..  this conde only works with Windows XP

Chad(Posted 1+ years ago)

 Kinda funny, should hide it somewhere in a program and if they press it, :-D

wizzlefish(Posted 1+ years ago)

 Hmmm...I could make it automatically run when my sister gets on the computer and she'll only have 30 seconds...and in the last five seconds a skull comes up and yells "5...4...3...2...1!!" and then there's an explosion sound and the computer shuts down while the skull laughs maniacally!

Blaine(Posted 1+ years ago)

 Instead of being:
Code: [Select]
Function DLLShutdown(parm$="-s -t 0",path$="C:")
ExecFile path$+"WINDOWSsystem32shutdown.exe"+parm$
End Function
it should be:
Code: [Select]
Function DLLShutdown(parm$="-s -t 0")
ExecFile SystemProperty("systemdir")+"shutdown.exe"+parm$
End Function
Tested with XP.  Should work on other versions of Windows as well.

Ked(Posted 1+ years ago)

 I don't understand what to press to make it work...._________________Your just jealous because I'm human.

t3K|Mac(Posted 1+ years ago)

 nice one for dealing with onlinecheaters ;)

xlsior(Posted 1+ years ago)

 You can terminate the pending shutdown by doing a shutdown /a from the command line during the 30 second countdown.

t3K|Mac(Posted 1+ years ago)

 most cheaters don't know that.

Ked(Posted 1+ years ago)

 Thank you, thank you

Ked(Posted 1+ years ago)

 For some reason this doesn't work on my computer. I ran it and nothing happened.

kevin8084(Posted 1+ years ago)

Code: [Select]

kfprimm(Posted 1+ years ago)

 needs to be
Code: [Select]
Function DLLShutdown(parm$="-s -t 0")
ExecFile SystemProperty("systemdir")+"shutdown.exe "+parm$
End Function

pexe(Posted 1+ years ago)

 BTW: I've fixed the code. Now it includes systemproperty ;)

BlitzSupport(Posted 1+ years ago)

 Ha, welcome back!

*(Posted 1+ years ago)

 With shutdown.exe you can do an instant shutdown so no chance of aborting it, used to do it on me step-sons computer he was prone to playing it till late so make his computer stay shutting down till 8am in the morning.

_PJ_(Posted 1+ years ago)

 <div class="quote"> nice one for dealing with onlinecheaters ;)  </div>Pretty sure there's some dodgy legal ground if your application initiates a shutdown procedure on someone's PC without their say-so. [/i]


SimplePortal 2.3.6 © 2008-2014, SimplePortal