{"id":46,"date":"2011-03-21T21:43:53","date_gmt":"2011-03-21T21:43:53","guid":{"rendered":"http:\/\/emtunc.org\/blog\/?p=46"},"modified":"2011-06-09T12:29:05","modified_gmt":"2011-06-09T11:29:05","slug":"dropbox-automatically-standby-pc-after-sync","status":"publish","type":"post","link":"https:\/\/emtunc.org\/blog\/03\/2011\/dropbox-automatically-standby-pc-after-sync\/","title":{"rendered":"Dropbox &#8211; Automatically Standby PC After Sync"},"content":{"rendered":"<p><a href=\"https:\/\/www.dropbox.com\/tour\" target=\"_blank\">Dropbox<\/a> &#8211; another piece of software I couldn&#8217;t possibly live without.<\/p>\n<p>If you use Dropbox, you may have come across a situation whereby you&#8217;ve just put a few large files in your Dropbox which will take some time to sync.<\/p>\n<p>One solution to this problem (without leaving your machine on all day or night) is to use a batch file which does the following:<\/p>\n<ol>\n<li>Uses a small executable created by a <a href=\"http:\/\/forums.dropbox.com\/topic.php?id=29075\" target=\"_blank\">member<\/a> of the Dropbox forums<\/li>\n<li>This executable checks the status of Dropbox (synching, in-use, up-to-date etc)<\/li>\n<li>The batch script simply runs in the background and checks the status of Dropbox every 30 seconds<\/li>\n<li>If the status is <em>up-to-date<\/em>, the script executes a command which puts the machine in to standby.<\/li>\n<\/ol>\n<p><!--more--><\/p>\n<h2>Code<\/h2>\n<p><code>@echo on<br \/>\n:CHECKSTATUS<br \/>\ndbFileStatus.exe \"C:\\location\\to\\DropboxFolder\" &gt; dbstatus.txt<br \/>\nfindstr \/m \"up to date\" dbstatus.txt<br \/>\nif %errorlevel%==0 (<br \/>\n%windir%\\System32\\rundll32.exe powrprof.dll,SetSuspendState<br \/>\n) else (<br \/>\nSLEEP 30<br \/>\nGOTO CHECKSTATUS<br \/>\n)<\/code><\/p>\n<ul>\n<li>Replace <strong>C:\\location\\to\\DropboxFolder <\/strong>with the location of your actual Dropbox folder<\/li>\n<li>The <strong>SLEEP <\/strong>is in there to prevent the script from looping it self hundreds of times per second. It is set to 30 seconds but this is configurable.<\/li>\n<li><strong>%windir%\\System32\\rundll32.exe powrprof.dll,SetSuspendState <\/strong>&#8211; this makes the machine go to standby<strong>&#8230; <\/strong>change it to<strong> %windir%\\System32\\shutdown -s -t 0 <\/strong>if you want to shutdown instead.<strong><em><br \/>\n<\/em><\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Download<\/h2>\n<p>You can download the batch script from <a href=\"http:\/\/emtunc.org\/blog\/wp-content\/uploads\/2011\/03\/dbStatusChecker.zip\" target=\"_blank\">here<\/a> &#8211; it also includes the <em>sleep <\/em>command line tool as I know some Windows systems do not have it by default (Windows XP being one of them).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dropbox &#8211; another piece of software I couldn&#8217;t possibly live without. If you use Dropbox, you may have come across a situation whereby you&#8217;ve just put a few large files in your Dropbox which will take some time to sync. One solution to this problem (without leaving your machine on all day or night) is [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[1],"tags":[5],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-tech","tag-dropbox"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1trTO-K","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":1,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":948,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions\/948"}],"wp:attachment":[{"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emtunc.org\/blog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}