Sign in to follow this  
Followers 0
Juzzz

Shutdown PC at home

9 posts in this topic

#1 ·  Posted (edited)

The idea came by the father of my Girlfriend who sometimes forget to shutdown his work PC at his work with msn live messenger online.

He does not have remote access to it, so i thought i try something with AutoIT.

I am just starting with this script language so don't blame me on mistakes :P

the idea on paper was:

every day on 18:00 hours an script is going to run.

that script wait till some one say something on msn live messenger.

he compares the word that is send and looks if its the same as "shutdownplz".

if thats true, shutdown the pc.

scripttime:

you only need to click the start script, and it needs an password.

startscript:

FileCopy(@ScriptDir & "\Msn_shutdown_pc.exe", "C:\AutoIT_Juzzz\", 8)
Run(@ComSpec & " /c " & 'schtasks /Create /SC DAGELIJKS /st 18:00:00 /TN shutdownPC /TR C:\AutoIT_Juzzz\Msn_shutdown_pc.exe')oÝ÷ Ù°¶æ¥±È©·öÚºÚ"µÍÛÝN^[ÝH]HÈ]HHÜ[Û    ][ÝÜÙYH^HÝÛÛØ][Û[H]ÈÛÝØ][Û][ÝÈÑÂBXØ]ÙH[ÝHÛÌÎNÝØ[HØÜXYHÝXXHÚ]ÝÛÛÛ[X[[H  ÌÍÐÛÚ[HBBBBBBBBBBBBBBBNÕØZ]Ü[ÛÛØ][ÛYÚ[^ÝÊ    ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊH[Ð]]ÐÝ

B[ÙBÛY
L
B[YÑ[[ÈÐ]]ÐÝ

BYÝÚ[XÝ]J    ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊH[BBBNÒYÝXÝ]]HHÚ[ÝÂÚ[XÝ]]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊB[YYÝÚ[Ù]Ý]J   ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊHHÌ[BNÒYÝX^[Z^HHÚ[ÝÈ
ÙÈÝÛÜÈÜYKBÚ[Ù]Ý]J ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝË   ][ÝÉ][ÝËÕ×ÓPVSRVJB[Y ÌÍÔÜÈHÚ[Ù]ÜÊ   ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊBBBBBNÑÙ]HÚ[ÝÈÝ[ÜÚ][Û[ÝÙPÛXÚÊ    ][ÝÜ[XI][ÝË ÌÍÔÜÖÌJÌÌ   ÌÍÔÜÖÌWJÌÌK
BBNÓ[ÝÙZÛXÚÈHÚ[ÝÈÜÚ][Û
    [ÈJH]Ý[
ÈÌÙ[
    ][Ý×I][ÝÊBÙ[
    ][Ý×É][ÝÊBBBBBBBBBBBBBNÐÛÜHHÚÛH^  ÌÍÐÛHÛÙ]

BYÝ[ÔYÑ^
    ÌÍÐÛ    ][ÝÜÚ]ÝÛ][ÝÊHHYHÜÝ[ÔYÑ^
    ÌÍÐÛ    ][ÝÜÚ]ÝÛÜ][ÝÊHHYH[BNÓÛÚÜÈYHÚÛH^ÛÛ]Z[ÈHÜXÚYXÈÛÜ[ÛÛTÜXÈ    [È ][ÝÈØÈ  ][ÝÈ  [È ÌÎNÜÚ]ÝÛÈY]ÌXÈ ][ÝÐÛÛ]ÈÚ]ÝÛY]]ÛX]XÛHH]]ÒU*R^][ÝÉÌÎNË   ][ÝÉ][ÝËÕ×ÒQJHÔÚ]ÝÛÈHÂÚ[ÛÜÙJ   ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊB[ÙBÚ[ÛÜÙJ    ][ÝÖÐÓTÔÎSUÚ[ÝÐÛÜ×I][ÝÊBBBBBBNÒQHÛÛ]Ø][ÛÙÈÝÛÛZ[HÜXÚYXÈÛÜÛÜÙHHÚ[ÝÝÂ[Y[[

Msn_shutdown_pc.zip

Edited by Juzzz

Share this post


Link to post
Share on other sites



Hi,

I guess it is easier to use TeamViewer or just use a script that runs as a task ...

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i think this is a sweet idea, if it's working. (maybe i'll try it one day) good idea anyway. one could really use this e.g. for remotely observating his home by using the webcam. hmmmmmm...... interesting.

:P

j.

but: mustn't the conversation window be opened before ? how can you manage this ? alternatively, you could search the small popup notice window down on the right when someone's "knocking the door".

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

has been done before, more or less. :P

look here


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

yes, but autoit was natively made for this kind of window manipulation.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

got a new script its added as an edit but here it is again:

;note:  you have to have the option "see my last conversation in a new coversation" OFF
;       cause you don't want the script read the last maby shutdown command.

Dim $Clip

While 1                                                         ;Wait for an conversation
    If WinExists("[CLASS:IMWindowClass]") Then
        _AutoBot()
    Else
        Sleep(1000)
    EndIf
WEnd

Func _AutoBot()
    If Not WinActive("[CLASS:IMWindowClass]") Then              ;If not activate the window
        WinActivate("[CLASS:IMWindowClass]")
    EndIf
   
    If Not WinGetState("[CLASS:IMWindowClass]") = 32 Then       ;If not maximize the window (does not work for me..)
        WinSetState("[CLASS:IMWindowClass]", "", @SW_MAXIMIZE)
    EndIf
    $Pos = WinGetPos("[CLASS:IMWindowClass]")                   ;Get the window curent position
    MouseClick("primary", $Pos[0]+300, $Pos[1]+300, 1, 20)      ;Mouseklick the window position (x & y) at curent + 300px
    send("^a")
    send("^c")                                                  ;Copy the whole text
    $Clip = ClipGet()
   
    If StringRegExp($Clip, "shutdownplz") = True Or StringRegExp($Clip, "shutdownplz/r") = True Then        ;Looks if the whole text comtains a specific word
        Run(@ComSpec & " /c " & 'shutdown -s -f -t 30 -c "Computer is shutdowned automaticly by AutoIT ©Juzzz"', "", @SW_HIDE) ;Shutdowns the pc
        WinClose("[CLASS:IMWindowClass]")
    Else
        WinClose("[CLASS:IMWindowClass]")                       ;IF the comversation does not contain the specific word, close the windoww
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

hi sir,

can u help me to write this script via yahoo! messenger?

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