VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Absolutely Fastest, Smallest Code to Shutdown a Windows NT/2000/XP Computer

Ion Alex Ionescu  (9 Submissions)   Windows API Call/Explanation   VB Script   Beginner   Wed 3rd February 2021

This code instantly shuts down any NT-based OS, ie Windows NT 4, Windows 2000, XP, Server 2003, Longhorn, etc. (Not 95/98/Me).

I know there's a lot of code on the site that does this, but remember that on NT, things get harder because your process needs the shutdown privilege. Other coders have used Win32 APIs to gain this privilege, but as I have said in my previous articles...the power lies in Native API.

In this unique example, only a single API call is needed to enable the privilege, followed by another API call to instantly terminate the computer. If you compile this application, double-clicking on it will shut down your PC within a second.

Do what you please with it...it might not be very useful most of the time (because it doesn't save any files), but if you ever need a quick shutdown (let's say you just ran a virus), this is as fast as pulling out the power cord.

Returns
A closed PC.

Side Effects
Nothing will be saved, instant shutdown.

API Declarations
RtlAdjustPrivileges
NtShutdownSystem

Rate Absolutely Fastest, Smallest Code to Shutdown a Windows NT/2000/XP Computer (8(8 Vote))
Absolutely Fastest, Smallest Code to Shutdown a Windows NT/2000/XP Computer.bas

Absolutely Fastest, Smallest Code to Shutdown a Windows NT/2000/XP Computer Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters