 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ripter
Joined: 23 Jun 2007 Posts: 1
|
Posted: Sat Jun 30, 2007 8:17 am Post subject: Remotely run a .exe through cell phone text |
|
|
Basically I want something that: checks my email (sent by cell phone), if a certain email is recieved it will run a .exe. And maybe some interface as to what I can do with it (like stop the program).
Does anyone know what program to run alongside AutHotkey to make it work?
Any kind of push in the right direction is welcome. |
|
| Back to top |
|
 |
daonlyfreez
Joined: 16 Mar 2005 Posts: 949 Location: Berlin
|
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Sat Jun 30, 2007 3:04 pm Post subject: |
|
|
what email client are you using? you can set up filters in outlook (for example) that run an exe when a certain criteria is met, as well as have another exe for stopping it when you email a "stop code"....
Hmmm, you just gave me alot of ideas for monitoring my workload from my blackberry.... _________________
(Common Answers) |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Sun Jul 01, 2007 3:21 am Post subject: |
|
|
I have some code along these lines.. its not finished.. but the intention was to build up an email-checker (an addy i dont use anywhere but for this..) that I can send to via my SMS/email (phone), and then get responses back to my phone from the pc .. like weather etc etc
Maybe you can use parts of it for your project
Again.. its certainly not finished, so dont laugh you guys.. lol
You can put string filters in at the "Commands:" section, etc to branch off your exe run files.. and even work some blat in there to send confirmation back to your cell.
edit (Jul1/ 12:15e): worked on it more, now it actually works.. sorry about that !
edit again, added the "Hide" function to the getmail command
| Code: | #SingleInstance
;
;Check existance of getmail.exe and blat.dll
;
IfNotExist, getmail.exe
{
GoSub, MissingGetMail
}
IfNotExist, blat.dll
{
GoSub, MissingBlat
}
IfNotExist, SMSER.ini
{
Goto, SMSERConfig
}
ReadINI:
IniRead, Server, SMSER.ini, User, Server
IniRead, UserName, SMSER.ini, User, UserName
IniRead, Password, SMSER.ini, User, Password
IniRead, Authorized, SMSER.ini, User, Authorized
IniRead, CheckPeriod, SMSER.ini, User, CheckPeriod
EnvMult, CheckPeriod, 1000
CheckMail:
Run, "getmail.exe" -u %UserName% -pw %password% -s %server% -delete,, Hide
WinWaitClose, getmail.exe
Sleep, 1000 ; allow time for txt files to get written to hd before proceeding, inc/dec as required..
Loop, *.txt
{
AuthPass = ""
Loop, Read, %A_LoopFileName%
{
If A_LoopReadLine Contains Subject:
Subject = %A_LoopReadLine%
If A_LoopReadLine Contains Date:
Date = %A_LoopReadLine%
IfInString, A_LoopReadLine, %authorized%
AuthPass = %A_LoopReadLine%
}
StringTrimLeft, Date, Date, 5
StringTrimRight, Date, Date, 6
StringTrimLeft, Subject, Subject, 8
IfNotEqual,AuthPass,""
{
GoSub, Commands
}
}
FileDelete, MSG???.txt
Sleep, CheckPeriod
Goto, CheckMail
ExitApp
Commands:
FileAppend, %Date% %Subject% %AuthPass% `n, commandlog.log
StringReplace, AuthOps, AuthPass, %Authorized%, ; strips the password from the commands/etc
; now you would have the commands as issued, minus the password
Msgbox, %AuthOps%
Return
MissingGetMail:
MsgBox, 1, File Missing, File Needed: GetMail.exe `n Click OK to download getmail.exe to this program's working directory.`n Extract Getmail.exe then restart this program to Continue.
IfMsgBox, Cancel
ExitApp
IfMsgBox, OK
URLDownloadToFile, http://www.interlog.com/~tcharron/getmail.zip, Getmail.zip
Run, %A_WorkingDir%
Return
MissingBlat:
MsgBox, 1, File Missing, File Needed: Blat.dll `n Click OK to download blat.dll to this program's working directory.`n Extract Blat.dll then restart this program to Continue.
IfMsgBox, Cancel
ExitApp
IfMsgBox, OK
URLDownloadToFile, http://downloads.sourceforge.net/blat/blat262.full.zip, Blat.zip
Run, %A_WorkingDir%
Return
SMSERConfig:
Gui, Add, Text, x26 y0 w340 h30 , Configure User - Enter server`, username and password for email account to be monitored.
Gui, Add, Text, x26 y30 w140 h20 , Server (ie mail.someisp.com)
Gui, Add, Edit, x166 y30 w200 h20 vServer
;GuiControl,,Server, %Server%
Gui, Add, Text, x26 y60 w140 h20 , Username
Gui, Add, Edit, x166 y60 w200 h20 vUserName
;GuiControl,,UserName, %UserName%
Gui, Add, Text, x26 y90 w140 h20 , Password
Gui, Add, Edit, x166 y90 w200 h20 password vPassword
;GuiControl,, Password, %Password%
Gui, Add, Text, x26 y120 w140 h20, Authorizing Word
Gui, Add, Edit, x166 y120 w200 h20 authorized vAuthorized
;GuiControl,,Authorized, %Authorized%
Gui, Add, Text, x26 y150 w140 h20, Checking delay in seconds
Gui, Add, Edit, x166 y150 w200 h20 CheckPeriod vCheckPeriod
Gui, Add, Button, x36 y200 w120 h30 , OK
Gui, Add, Button, x216 y200 w120 h30 , Cancel
Gui, Add, Text, x96 y240 w190 h20 , Note`, data will be stored in SMSER.ini
; Generated using SmartGUI Creator 4.0
Gui, Show, x131 y91 h268 w394, SMSER Configuration
return
ButtonCancel:
ExitApp
ButtonOK:
GuiClose:
Gui, Submit, NoHide
IniWrite, %Server%, SMSER.ini, User, Server
IniWrite, %UserName%, SMSER.ini, User, UserName
IniWrite, %Password%, SMSER.ini, User, Password
IniWrite, %Authorized%, SMSER.ini, User, Authorized
IniWrite, %CheckPeriod%, SMSER.ini, User, CheckPeriod
Gui, Destroy
Sleep, 1000
Goto, ReadINI
|
Last edited by Dave72 on Sun Jul 01, 2007 6:17 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Sun Jul 01, 2007 4:18 pm Post subject: |
|
|
Mainly a bump for the edit I did on the code..
But also.. does anyone know of an email grabber like getmail.. but that is in the .dll form (like blat).. having the command window pop up every nn seconds is sort of annoying to say the least.
Or, is there a way to suppress the command window ? |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Sun Jul 01, 2007 4:58 pm Post subject: |
|
|
| Dave72 wrote: | | Or, is there a way to suppress the command window ? |
Yeah, there is. Try:
Run, "getmail.exe" -u %UserName% -pw %password% -s %server% -delete, , Hide |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Sun Jul 01, 2007 6:16 pm Post subject: |
|
|
| Fantastic, ManaUser.. it didnt even occur to me that AHK itself would be able to suppress this. Thanks for the tip, works great now ! |
|
| Back to top |
|
 |
Alexander
Joined: 01 Jul 2007 Posts: 17
|
Posted: Sun Jul 01, 2007 6:19 pm Post subject: |
|
|
| That is something that would be quite usefull to me... Do you mind if i grab that code for my use? |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Mon Jul 02, 2007 1:38 am Post subject: |
|
|
Absolutely you can, thats what we're all about here !
I got to playing around a little more, made a pop-up message thingy, so you can send transient to-do lists etc from the phone. Once you close the gui window though,its gone (easy enough to send to file tho..)
To send from SMS (or any email source, of course..) send your authorizing word plus the word "Popup" and then the actual text you want to display in the popup.
Put this in to replace the MsgBox line in the Commands: section
| Code: | ;--- A desktop PopUp window, for to-do lists etc
IfInString, AuthOps, PopUp
{
StringReplace, Message, AuthOps, PopUp
Gui,2: Add, Text,, %Message%
Gui,2: Show, W200 H200
}
;--- end of desktop popup |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|