Pinterest Stumbleupon Whatsapp
Ads by Google

You’re on the road, racing to your morning meeting, and then it dawns on you that in your haste out the door, you’d left your computer turned on. Normally, you’d kick yourself all the way to the office for the electricity you’re going to waste leaving your computer idling all day at home, but not today. Today, you pull over to the side of the road, send a quick text stating “shutdown #mycomputer”, and then head off again to work. Job done.

This scenario is possible – or one where you need to kick off a virus scan, initiate a website backup, ping a server and email the results, and a whole list of other jobs right from your home computer, while you’re not even at home. Not only is it possible, but it’s actually pretty easy to do by combining together Dropbox and IFTTT, and writing a little bit of simple Windows Script. If you’re new to Dropbox, check out our full guide DOWNLOAD The First Unofficial Guide To Dropbox DOWNLOAD The First Unofficial Guide To Dropbox Read More on it.

Have no fear, I’ll show you how to set up the system, how to write your first Windows Script File (WSF) command that you can trigger using a text message, and then I’ll send you off with a final list of other scripts you could launch on your home PC via a simple text message. Sound like fun? Let’s roll.

Set Up Dropbox and IFTTT

Here’s how this system works. First, you send an SMS command to IFTTT 10 Of The Best IFTTT Recipes To Bring Order Into Your Online Social Life 10 Of The Best IFTTT Recipes To Bring Order Into Your Online Social Life Tell yourself how many minutes of the day you give to the time sink that goes by the name of Twitter, Facebook, Pinterest, or any other. The minutes add up. Wouldn't it be wonderful to... Read More , which takes your command and translates it into a text file that gets placed into a special folder on your Dropbox account. Meanwhile, you’ve configured your computer to regularly monitor that directory and watch for the text files. When it sees a new text file shows up, your computer will follow whatever command is identified by the name of the file.

The first step of this is to create a special folder in your Dropbox account just for the purpose of allowing IFTTT to place these “command” files.

txt-pc-control1

Ads by Google

Once you’ve done this, go into your IFTTT account and create a new recipe. Choose SMS as the trigger channel, and then “Send IFTTT an SMS tagged” as the trigger.

txt-pc-control2

This lets you define a special tagged SMS that will trigger IFTTT to take action. You can call the special tag anything you want. In my case, I called it #mycomputer.

txt-pc-control3

IFTTT provides you with a special phone number to send your SMS commands to. Make note of this number and save it to your phone contacts list. This is the number you’ll use to command your computer remotely.

txt-pc-control4

Next, still in IFTTT, you’ll need to select the “This” action. Choose the Dropbox Action channel, and then choose the “Create a text file” action.

txt-pc-control5

Set it up to use the special Dropbox folder you’ve created, and you can leave the rest of the fields as default. You’ll notice that the File name of the file placed into the Dropbox folder is the message that you type into your phone. So, if you want IFTTT to place a text file called shutdown.txt in your Dropbox folder, then you’ll text the phrase “shutdown.exe #mycomputer” – that’s it!

txt-pc-control6

Now IFTTT is configured to receive your SMS and insert the text file that you’ve told it to, directly into the special remote control folder you’ve set up in Dropbox just for this purpose.

Now that this is done, it’s time to set up your computer to monitor that special folder, and respond whenever any new text files arrive.

Setting Up Your Computer

The first thing you’ll want to do is install Dropbox on your computer if you haven’t already. Just go to your Dropbox account, click on your profile name dropdown and click on the “Install Link”.

txt-pc-control7

Once you’re done with that, you’ll need to configure the Windows Script that will regularly monitor your Dropbox folder and look for new text files to appear.

<job>
<script language=”VBScript”>

Dim file1
Dim objShell
Dim strComputer
Dim strShutdown

Set file1 = CreateObject(“Scripting.FileSystemObject”)

If (file1.FileExists(“C:\Users\Owner\Dropbox\Remote_Control\shutdown.txt”)) Then
file1.DeleteFile “C:\Users\Owner\Dropbox\Remote_Control\shutdown.txt”
strComputer = “Owner-PC”

strShutdown = “shutdown.exe -s -t 0 -f -m \\” & strComputer
set objShell = CreateObject(“WScript.Shell”)
objShell.Run strShutdown
end if

Wscript.Quit
</script>
</job>

All you need to do is edit this file and add a new “If” statement for every different text file and command that you want to add to your new SMS-Command system. In the script above, the “FileExists” command checks whether the “shutdown.txt” is present in the Dropbox path. If it is there, it immediately deletes the file, and then runs the Shutdown command.

Save this anywhere on your PC that you like, and then set up a scheduled task to run it at some frequency. In my case, I run it every hour to check the Dropbox folder for new SMS commands.

txt-pc-control8

Just add the path of the monitoring script under the “Actions” tab in your scheduled task.

txt-pc-control9

Don’t forget to select “Wake the computer to run this task”, so that the task will still run when you aren’t around the computer.

txt-pc-control10

The system is now good to go.

Issuing Your Computer Text Messages

Running a quick test, I sent an SMS of “shutdown #mycomputer” to the IFTTT phone number, and within less than 20 seconds, I received the file in my Dropbox account.

txt-pc-control11

Another section of script that I added was the one for pinging a website and emailing the results code that you can find at my article on 3 awesome Windows scripts 3 Awesome Things You Can Do With Windows Scripting 3 Awesome Things You Can Do With Windows Scripting Whether you work in the IT field, as a web designer, or if you are just a student or regular office worker, Windows Scripting has something to offer you. Of course Applescript does as well,... Read More . Just putting this inside an If statement in the same WSF file described above – looking for “pingsite.txt” in the Dropbox folder will trigger that section of code.

txt-pc-control12

That script can be triggered simply by texting “pingsite #mycomputer”. IFTTT puts “pingsite.txt” into the Dropbox folder, the hourly script spots it, and runs that section of code! It’s a solution that will work for any WSF script that you can think up – just add it to the file under a new section looking for a text file under a different name in the Dropbox folder. The possibilities are unlimited.

You text, your computer responds.

Have you ever accomplished SMS-to-computer automation like this? If so, what approach did you take? Do you like this approach? Share your own tips and feedback in the comments section below!

Image Credit: Hand With Cellphone via FreeDigitalPhotos.net

  1. Micah Lahren
    July 13, 2015 at 2:47 pm

    @theCheek - Try AutoIt instead of that script type that was suggested in the article. It's more user friendly and easier for beginner programmers to pick up and write any script to do anything on their computer.

    • Micah Lahren
      July 13, 2015 at 2:55 pm

      e.g. You can either create a script that will run every 15 minutes or so that checks for the file and if it exists, do something on your computer, or create an executable file with AutoIt that you can schedule to run every 15 minutes to check for the file. The level of customization and power with AutoIt is something anyone who loves automation should check out.

  2. theCheek
    March 24, 2015 at 9:30 am

    Very cool idea, looks like the author has abandoned these comments though due to a number of repeated questions. Wish people would read!

    I've made a small change as I live somewhere the text message channel on IFTTT does not work. So instead I made the trigger when I leave home using Life360.

    I also changed the Dropbox usage to Google Drive instead.

    The only issue I have however, is that the scheduled task doesn't seem to run properly. The script file, when double clicked, is just fine, but whenever I run it via the Scheduled Task, nothing happens.

  3. Lotr
    January 6, 2015 at 9:19 pm

    When I try to send an SMS to the number IFTTT made for me I get from my operator: Destination not allowed. How can I fix this?

  4. Will
    October 16, 2013 at 2:59 pm

    How to set up Mobile Phone not working

  5. Will
    October 16, 2013 at 2:53 pm

    how to set up in ifttt it has changed asking for recipe

  6. Anat very knowledgeable
    October 8, 2013 at 6:10 pm

    Regarding security:
    Even if they had access to your dropbox and IFTTT, wouldn't they also have to store a script on your machine?

  7. Anonymous
    October 8, 2013 at 6:08 pm

    Regarding security:
    Even if they had access to your dropbox and IFTTT, wouldn't they also have to store a script on your machine?

  8. dragonduder
    September 19, 2013 at 1:55 am

    Using an earlier MUO article, http://www.makeuseof.com/tag/xx-ways-clean-computer-automated-script/

    Add this to scan your PC with MRT when you text "scan":

    If (file1.FileExists("C:UsersPCDropboxRemote_Controlscan.txt")) Then
    file1.DeleteFile "C:UsersPCDropboxRemote_Controlscan.txt"

    strScan = "C:WindowsSystem32mrt.exe /Q /F:Y"
    set objShell = CreateObject("WScript.Shell")
    objShell.Run strScan
    end if

  9. dragonmouth
    September 18, 2013 at 1:35 pm

    It may be kewl but how secure is this procedure? If you can command your PC with a text message, can't other people?

    • dragonduder
      September 18, 2013 at 10:48 pm

      Only if they have access to your dropbox or IFTTT.

    • dragonmouth
      September 19, 2013 at 12:58 pm

      As if dropbox and IFTTT cannot be hacked.

    • dragonduder
      September 20, 2013 at 11:28 pm

      Then the OBVIOUS question isn't "how secure is this procedure", but "how secure are my dropbox and IFTTT accounts".

  10. Vala Z
    September 18, 2013 at 7:05 am

    @Ryan Dube
    Thanx it worked. Is there any way to hibernate the PC instead? I want to learn more about Windows Scripting. I have absolutely no knowledge of it. Any recommendations?

    • dragonduder
      September 18, 2013 at 10:51 pm

      I think the command line code for hibernate is "shutdown -h", try replacing the shutdown in the code above with that and see if it works. I'll try it and report back in a few

  11. DT
    September 18, 2013 at 1:39 am

    Hey Ryan, just curious, in the screenshots showing the task scheduler, what are those two extra buttons in the upper right of the dialog window? Thanks, David

  12. R Hopgood
    September 17, 2013 at 4:54 pm

    Can this be done with other cloud services??

  13. Ben
    September 17, 2013 at 1:33 am

    Can you give some more examples of how to write script for common tasks? Like maybe running a virus scan, or checking for updates, etc. I liked this a lot, but I feel like I set everything up and now I don't know what to do with it.

    • TechnoAngina
      September 17, 2013 at 4:31 pm

      Calling program is actually a pretty basic operation. You can look up something as simple as Windows Batch scripting. Googling will bring up some pretty decent tools. You'll probably also want to look up if applications have a CLI or command line interface. If you're looking to get really powerful I'd recommend jumping into some basic VBscript or Powershell. You can do a lot with your computer if you know what you want to do with it. Unfortunately I think they would have to run a series to be able to do what you're asking.

    • dragonduder
      September 18, 2013 at 1:55 am

      I think I got the hang of it. Basically anything you can do in the command line, you can add to the wsf script. For instance, I added this to the script and it should trigger a quick scan with Microsoft Security Essentials if it finds a "scan.txt" file in my Dropbox folder:

      If (file1.FileExists("C:UsersNAMEDropboxRemote_Controlscan.txt")) Then
      file1.DeleteFile "C:UsersNAMEDropboxRemote_Controlscan.txt"
      strComputer = "NAME-PC"

      strScan = ""C:Program FilesMicrosoft Security ClientMpCmdRun" -Scan -ScanType 1" & strComputer
      set objShell = CreateObject("WScript.Shell")
      objShell.Run strScan
      end if

    • dragonduder
      September 18, 2013 at 2:42 am

      Damn, on second thought I'm getting an error trying that code. Anyone got a fix?

  14. John Doe
    September 16, 2013 at 11:39 pm

    Why go through this long process, when there are apps out there such as VNC or Unified Remote, which controls both PC shutdown options but controls it from anywhere in the globe. Just Saying, make life smarter, not harder.

    • Ryan Dube
      September 17, 2013 at 7:24 pm

      Because doing it via Text Message is just...really cool. :-)

      And it could have implications for larger, even cooler applications - if someone is clever enough to work out other uses for this.

  15. dragonduder
    September 16, 2013 at 10:47 pm

    Very cool, received an error message though. Any assistance? Upon running the script (clicking on it or running the task) I receive the following message.

    ---------------------------
    Windows Script Host
    ---------------------------
    Script: C:UsersRyan2DropboxDBScript.wsf
    Line: 2
    Char: 10
    Error: The value for the attribute is not valid : language
    Code: 80040049
    Source: Windows Script Host

    ---------------------------
    OK
    ---------------------------

    Is there an error in the coding? I copied it directly from above. Thanks!

    • TechnoAngina
      September 17, 2013 at 4:27 pm

      Are you an admin on your machine? Someone else got the same issue above and from the research I've done on it, it appears to be an incorrect registry setting of some sort.

    • Ryan Dube
      September 17, 2013 at 7:23 pm

      Please see the solution posted above (worked for me) - WSF is sensitive to the use of curly-quotes and you will receive this language error because the "script language=”VBScript”" part of the program isn't being recognized.

    • dragonduder
      September 18, 2013 at 1:41 am

      I fixed it by changing the quotation marks to the quotes on my keyboard. I believe when the author posted it above, the quotations were from Word or something and don't translate well to the notepad. idk, but changing the quotes worked! I use this to remote shutdown and reboot my pc now, very cool. Someone list more cool ideas for WSF scripting!

    • hamza
      September 24, 2013 at 11:39 am

      remove the 2nd line

  16. Andrei
    September 16, 2013 at 9:25 pm

    In my country most of the SMS-related services are not available but I've used TweetMyPC to accomplish a similar thing. Not sure if it still works with the current Twitter API. Love this stuff by the way, do more!

  17. Xavier
    September 16, 2013 at 9:02 pm

    I had an error on the windows script:
    Script: C:Users****DesktopmonitorCommands.wsf
    Line: 2
    Char: 10
    Error: The value for this attribute is not valid : language
    Code: 80040049
    Source: Windows Script Host

    Any ideas?

    • Suleiman
      September 17, 2013 at 3:33 pm

      i got the same error msg too. Where is Rayn, he should get involved in this discussion :)

    • TechnoAngina
      September 17, 2013 at 4:26 pm

      There's an error on your system. It can't call a specific DLL. You'd have to be able to figure out which registry key is invalid. Unfortunately it's a really generic error code, so more than that would be hard for me to give.

    • Ryan Dube
      September 17, 2013 at 7:21 pm

      I can repeat this error and have the following fix: You need to make sure not only to paste it into Notepad but actually retype the quotes ..."

      Otherwise it may keep the smart curly if you've copied it right out of here. I noticed when I pasted it into notepad that it kept the wrong style quotes, oddly enough. But when I deleted it and re-typed the quotes it worked fine. Give it a try.

    • dragonduder
      September 18, 2013 at 1:39 am

      Change the quotation marks to the quotes on your keyboard, that fixed mine!

    • Suleiman
      September 18, 2013 at 3:56 pm

      I did change the quotations. Assume my computer name is GTA5 and this is what i did. It is not working for me somehow:

      Dim file1
      Dim objShell
      Dim strComputer
      Dim strShutdown
      Set file1 = CreateObject("Scripting.FileSystemObject")
      If (file1.FileExists("C:UsersGTA5DropboxRemote_Controlshutdown.txt"))

      Then
      file1.DeleteFile "C:UsersGTA5DropboxRemote_Controlshutdown.txt"
      strComputer = "GTA5-PC"
      strShutdown = "shutdown.exe -s -t 0 -f -m \" & strComputer
      set objShell = CreateObject("WScript.Shell")
      objShell.Run strShutdown
      end if
      Wscript.Quit

      I am suspecting the error at : strComputer = "GTA5-PC", should it be strComputer = "GTA5" .

      One more thing, i sent a txt to ifttt as "shutdown #mycomputer" , it is case sensitive?

      Thank you for your help , i am just curious to see it working for me, and i am learning in the process .

    • dragonduder
      September 19, 2013 at 1:37 am

      I think

      strShutdown = “shutdown.exe -s -t 0 -f -m ” & strComputer

      should be

      strShutdown = “shutdown.exe -s -t 0 -f -m \” & strComputer

      As in two slashes.

      If that still doesn't work try changing

      If (file1.FileExists(“C:UsersGTA5DropboxRemote_Controlshutdown.txt”))

      Then

      to...

      If (file1.FileExists(“C:UsersGTA5DropboxRemote_Controlshutdown.txt”)) Then

      I don't think it matters that the Then is on the same line, but I guess it's worth trying.

  18. Suleiman Orotta
    September 16, 2013 at 8:28 pm

    ifff = ifttt sorry about that, i just knew about it today , thanks to Ryan for that.

  19. Suleiman Orotta
    September 16, 2013 at 8:21 pm

    Hey Ryan, thanks a lot for this, it was fun to learn new thing today. I followed your instructions all the way and lost my way when i reached at " Save this anywhere on your PC that you like, and then set up a scheduled task to run it at some frequency" . What is "it" and how do u save it and run the schedule . This is what i did. I saved the file as .vbs on notepad. I sent txt to ifff and i saw the pop up on dropbox. Now, which one do I have to schedule, the saved .vbs file or the dropbox. PS: I never did programming on Windows scripts before; all my guess was based on my C++ programing stuff. I can't wait to shutoff my pc with sms :) Thanks again for sharing this.

    • dragonduder
      September 16, 2013 at 11:22 pm

      Save the code above as DBScript.wsf. Save it somewhere like your My Documents folder. This file is what you will schedule.

      Also, before you finish saving the code above, change "owner" to the name of your pc (mine is Ryan, for instance) and change the quotation marks to the quotation marks on your keyboard. I would get an error message when I used the quotes in the code above (format error? idk)

      Excellent post! Works perfect when I fixed it up a little bit. I just wish the Task Schedule could automate sooner than once an hour.

    • TechnoAngina
      September 17, 2013 at 4:32 pm

      dragon nice troubleshooting! The keyboard and HTML codes for the quotation marks are actually different codes in computer language.

    • Ben
      September 17, 2013 at 5:41 pm

      Thanks for this. I had it saved as a .txt and it was running and opening notepad. That should have been clearer. Thanks!

  20. Vala
    September 16, 2013 at 6:50 pm

    Should I copy paste those lines into notepad and alter the path and pc owner name AND then change the extension to wsf? If yes I did that and after running the task I get this error:
    http://i.imgur.com/aSg5amZ.png?1

    • Ryan Dube
      September 17, 2013 at 7:20 pm

      I can repeat this error and have the following fix: You need to make sure not only to paste it into Notepad but actually retype the quotes ..."

      Otherwise it may keep the smart curly if you've copied it right out of here. I noticed when I pasted it into notepad that it kept the wrong style quotes, oddly enough. But when I deleted it and re-typed the quotes it worked fine. Give it a try.

    • dragonduder
      September 18, 2013 at 1:38 am

      Change all the quotation marks to the quotations on your keyboard. That's what fixed mine.

  21. Duckeenie
    September 16, 2013 at 6:33 pm

    I use a hacked NowTV box in my bedroom that I often use to stream from a Plex server running on my PC. I have been making do with a Windows task that turns my PC off at a select time as long as it isn't been used. Your solution is far more elegant, I will use this to try to learn a little IFTTT.

  22. Yashodhan B
    September 16, 2013 at 5:48 pm

    Hi there, first of all thanks for keeping the tone of the article geeky as well as informative.

    I tried as you told but the problem is that IFTTT SMS channel needs to be verified for your cell numbers, which for Indian numbers , can’t happen. Maybe Indian mobile providers are not allowed or I don’t know why but I wasn’t able to receive any kind of verification text on my cell phone when I tried to activate the SMS channel.

    I even tried prefixing 00 as well as 91 before my number.
    I had a postpaid number so I tried with prepaid one too but to no avail.

    • John P
      September 17, 2013 at 4:12 pm

      You might try pinger, you might be able to get a US number that way, and use it for your ifttt number. I've never tried it, but it seems like it might have a possibility of working.

Leave a Reply

Your email address will not be published. Required fields are marked *