In the last few days, I have found myself in a difficult situation where I would like to leave office early and there are some stuff I am doing on the computer that don’t need much of my intervention, only need a check and switch off the computer when done.(e.g. Installing some heavy antivirus)
How would you do this and you already left the office?
This might lead to leaving the computer on till the following day.
Now I thought. If I ran the command “shutdown -s -t **”, the computer might shut down before the its through. Same case applies to other auto shut Apps.
Option 2 would be the windows remote desktop connection: this requires a public IP, do some port forwarding and some good internet. This is not so secure for your PC. and its hectic too.
Option 3. Use online remote desktop controllers like Logmein. This might be a good idea but also need some fast, and I mean fast internet to do stuff on your computer.
So the only solution is think how to send a shutdown command to your computer remotely and easily. I came across a small program called “TweetMyPc” This small App checks your Twitter tweets for preset commands every minute. If your tweet is any of the preset commands, it runs the command on your computer.
Apparently, most preset commands are not working e.g. “shutdown, lock, getfile, logoff…” I am running TweetMyPc on Windows Server 2003 and think there might be some compatibility issues.
The App is friendly; you can create custom commands and point to a specific file. So I did create custom command pointing to my shutdown script.
Tweet the command name, and the computer switches off just fine.
One problem is solved. Now I don’t know if the computer is through or not. *thinking* the “screenshot” command on tweetmypc isn’t working.
I need a program to capture the screen and may be send the image via email. A command line print screen tool would help.
I got the command line App to capture the screenshot. Working too well and simple. The App is called “cmdcapture.exe”
Download the app to \windows\system32\
Create a batch file with the code “cmdcapture /f screenshot.jpg /d c:” replace screenshot.jpg with the file name you intend to use and “c:” with the path.
Create a custom command on TweetMyPc to point to your batch file, give your command a unique name. tweet that command on tweeter, wait circa 1 minute and check your path to see if your file has been saved.
Its working. Now we need an app to send us the image file. And by the way, why do we need command line tools and not GUI apps? We want to execute our apps with preset parameters so we need not intervene.
We need a combination of two apps here. One to encode the file to MIME and another to send the MIME attachment
Download Bmail and Mpack from the links “ftp://ftp.andrew.cmu.edu/pub/mpack/old/mpack15d.zip” and “http://www.beyondlogic.org/solutions/cmdlinemail/bmailv107.zip” and extract the contents of the Zip files to “…\windows\system32\”
Now add these two lines of code to our earlier created batch file on line 2 and 3 respectively.
2. mpack -s “Email Subject” -c image/jpeg -o body.msg c:\screenshot.jpg
3. bmail -s mail.server-p 25 -t email@example.com -f firstname.lastname@example.org -m body.msg
-c specifies the octet stream file type.
-o Is the file name where the translated mime will be stored. And its followed by the file path.
–s will specify the SMTP server
-t email to send to
-f email to send from
-h generate headers
-m specify the mime file you created earlier on with mpack on line 2
Again tweet your custom command, after confirmation (TweetMyPc will tweet the confirmation) check your mail.
Your screenshot is there.
With the power of custom commands, there is a lot more you can do to control your pc using TweetMyPc. You just need to think an extra mile.