Sync any folder to SkyDrive – Reloaded

[UPDATE: A new release with version number 1.2.1 is available http://ssx.codeplex.com/releases/view/101941]

The first release of SkyShellEx was an attempt to add on a sorely missed  feature in the SkyDrive desktop app for Windows. The ability to sync any folder on your disk to the cloud was one main differentiator of Live Mesh (R.I.P. 13th Feb 2013) over competitors like DropBox or GDrive. When I was quickly putting together a shell extension that could create folder junction in NTFS, I was hoping it would help out a few people. However, I was surprised by the traffic and feedback I got for my little hack. Thanks everybody for your nice comments and appreciation! Realizing that there is high demand for keeping existing folders structures intact but still taking advantage of cloud storage, I decided to implement a successor that eliminates issues of the old version and adds few new features. The result of this work , SkyShellEx 1.2, is now available at http://ssx.codeplex.com/ Grab the bits as long as they are fresh. I also would like to give a special Thanks to my old friend and awesome developer Danny Tomuschat. This release of SkyShellEx wouldn’t have been possible without his work.

[DISCALIMER: SkyShellEx, whether in the form of source code or executable, is provided As Is. There is no warranty that the software is appropriate for any specific use. While it is believed to be correct, there is no guarantee that the code does not contain either general errors or errors that my occur under specific combination of parameters or use. The practice of keeping regular backups of your data is strongly recommended.]

We will move your data and why it’s better

While the original SkyShellEx had only little impact on your file structure,  the new version will actually migrate your data into SkyDrive. However, like in the old version, your folder structure will be maintained. Only this time, the folder junction will be created as a surrogate at the original folder location. If moving your data is a big no-no for you then you have three options right now. First, you can stick with the old version of SkyShellEx and live with its shortcomings. Second, you keep reading and hopefully I can convince you why it’s better this way. Third, you can try to convince me to bring it back the old way as an option for a future version.

Syncing actually works now

Folder junctions created in the SkyDrive folder do sync when the junction is created. However, a lot of users, including me, reported that changes in the folder were not synced by SkyDrive. The only workaround was to restart SkyDrive or to create and delete a dummy file somewhere in SkyDrive in order to trigger a sync. Moving the actual folder into SkyDrive will circumvent this kind of issues.  Your files will be always fresh and up to date.

Enabling Device to Device Sync

Having real folders in SkyDrive also enables a scenario that wasn’t easily possible with folder junction. Let’s assume you have two or more PC’s and you want to sync your Music folder across all PC’s. While you could create the folder junction in SkyDrive for the first PC, you couldn’t do the same on any of the other PC’s. The junction just couldn’t be created because the folder Music already existed in SkyDrive. Now you have the possibility to exactly do this. Just to be clear this is NOT the peer to peer sync you know from Live Mesh. The sync always happens via the SkyDrive folder in the cloud. You have the choice to merge folders from different PC’s or to sync them side by side. More details below.

How it works

Since you still reading and not deterred by the fact that SkyShellEx moves your data around, lets talk about new features. Once installed, this release of SkyShellEx works in principle the same way as the previous one. Just right click on any folder on your disk and you will see a new context menu entry called Sync to SkyDrive. Well, actually not for any folder. We are actively preventing syncs of folders that live under Windows, System or Programs as well as folder from removable storage. If you can give me a good reason to allow you to mess with your system files then let me know. SkyShellEx is using a new icon with the right dimensions now.

image

If you click on the menu item “Sync to SkyDrive” and the selected folder doesn’t exist in SkyDrive then the folder will be silently moved and a surrogate folder in form of an folder junction will be placed at the original location. In case SkyDrive already contains a folder with the same name, we support two scenarios that will be handled by the following dialog.

image

In the first scenario “Merged folders” we assume that the folder is synced by SkyDrive from another PC and you want to sync the same folder with the current PC. If you select this option, your existing folder will be merged and again, the original folder will be replaced by a folder junction. The second scenario “Side by side” covers two cases. Like in the first scenario it could be a folder from another device, but this time you would rather have two versions of the same folder side by side. I In the subsequent dialog a new name with computer name  as a suffix is suggested or you can choose your own name.

image

The second use case covers the possibility that two folder with he same name live in different places on your disk. If you currently already sync a folder on your computer with the same name then SkyShellEx will suggest a new name that includes the parent folder name as a prefix or you can choose your own nameimage

Once a folder is synced via SkyShellEx, folder in SkyDrive as well as the junction gets a new icon. This allows you do identify more easily your synced folders. You will recognize that the new icon will show right away or not. Depending on the weather. moon phase or any other unrelated event, Explorer decides to show the icon sooner or later. If anybody knows how to force Explorer to always show the changed icon immediately then ping me. I will owe you.

image

In case you don’t want to sync your folder anymore and want your folder back as it was, just right click the folder or the junction and you will see a menu entry called “Stop syncing to SkyDrive”.

image

This will bring up a dialog that offers two options. The first one restores your folder at is original place but leaves a copy of your data in SkyDrive. This prevents that data get deleted from other machines that also sync the same folder. The second option also restores your original folder but removes it completely from SkyDrive. Be aware that the data wont be available for any other devices anymore.

image

Sharing folders

Sharing folders was another missing feature in the original release of SkyDrive. Also it is available now and we providing kind of redundant functionality here, I’m not a big fan on how SkyDrive is implementing sharing. Just opening a browser window looks kind of cheap to me. Well, we also using the web UI but we tried do it in a more elegant way, so it feels integrated with the Desktop. If you do your first sync you will be asked to trust us and give SkyShellEx access to your SkyDrive. Actually we just need this permission to resolve the local folder name to the folder ID used by SkyDrive. If you don’t want to answer this question every time then don’t forget to set the check mark on the “Remember access for SkyShellEx” option.

image

Once the folder name is resolved, you will see the familiar sharing screen from SkyDrive with all it’s options. We tried our best to hook into all the HTML events, so the Web UI behaves like a native window. We also worked on our own sharing solution via the Live SDK but soon we realized that the exposed API is to limited compared to the Web UI.

image

That’s SkyShellEx 1.2 and I hope it will be useful you. Give us your feedback and bug reports on CodePlex http://ssx.codeplex.com/

Sync any folder to SkyDrive

[Update: A new version of SkyShellEx is available. Read more about it here: http://janhannemann.wordpress.com/2013/02/13/sync-any-folder-to-skydrive-reloaded/]

With the arrival of the new SkyDrive app we are finally able to take advantage of the 25GB online storage. The new app https://apps.live.com/skydrive allows you to sync a specific folder to your online storage like Dropbox. It is very simple; just drop whatever you want into the SkyDrive folder and it’s up to the cloud. But it also comes with the same limitations like Dropbox. If you are a Live Mesh user then you probably appreciate that you can sync any folder on your hard drive to the cloud not matter where it is located. This is a very nice feature because it allows you to keep your existing folder structure. For some reason this feature didn’t make it into the SkyDrive app and Live Mesh will be discontinued soon.

NTFS to the rescue

Fortunately NTFS has some nice features that we barely use but can be very useful. One of them is symbolic links or folder junctions. Basically it allows you to mount a folder into another folder, so it looks like the folder is physically located there. So my thought was – if the Explorer can’t see it then SkyDrive can’t see it and will handle them as regular folders. The command to create such a link is:

MKLINK [[/D] | [/H] | [/J]] Link Target.

The /D parameter creates a symbolic directory link and it was my first try because they are recommended over directory junctions /J but SkyDrive crashed with symbolic links while directory junctions worked with no problems. Plus, we don’t need admin rights to create junctions. If you execute the command then a junction will be created that like a folder and SkyDrive starts syncing its content.

SkyShellEx

While the command line just works fine I wanted a more convenient way to sync my folders; a perfect match for a shell extension. So I spent a couple of hours on implementing a little helper that can be downloaded as 64 bit version here SkyShellEx_x64 and 32 bit version here SkyShellEx_x32 If you want to have a look at the source code first then you can find it here SkyShellEx_Project.

[Update: the original version has a bug that prevents syncing of folders that have one or more spaces in there full path. The version 1.01 fixes that problem. SkyShellEx_x64_1.01, SkyShellEx_x32_1.01, SkyShellEx_Project_1.01 You have to reboot to apply the changes.]

After installing the extension you will see one of two possible menu items when you right click a folder. The first one starts syncing a folder and shows up on any folder except ones that are already in the SkyDrive folder. The second menu stops the syncing of a folder and shows up on any ones that are already in the SkyDrive folder and is a directory junction. See screenshot below.

clip_image001       clip_image002

Limitations

I found the shell extension very useful but it has some limitations. Currently I can’t detect whether a folder is already syncing to SkyDrive. So you won’t see the “Stop Sync to Skydrive” menu but the “Sync to Skydrive” when you at the physical location of a folder that has already a junction to SkyDrive. It’s no problem to execute the command again but it’s confusing. It would be also useful to have an icon overlay on folders that sync to SkyDrive. If there is enough interest I would try to improve the tool but for now it works well enough for me.

Let’s go crazy – Cloud to Cloud Sync

You maybe get the same idea as I did when I played around with this and yes it works. You can sync folder between Dropbox and SkyDrive.

clip_image003

[Disclaimer: The approach presented in this blog post is not officially supported. My software is provided “as is," and you use the software at your own risk.]

Wake up Neo

I recently installed Windows Home Server 2011 on one of my old desktop computers. While Home Server is a great product which is easy to use, I couldn’t find a way in the UI to schedule sleep and awake times for my server. I know, I know it’s a server and it should run 24/7, but I don’t have one of those fancy, low powered, silent boxes. My old desktop has 500W power supply and makes some noise in the closet. Therefore I wanna put the server to sleep around 10pm and wake him up around 7am. If you don’t wanna do the configuration by hand then you can stop reading and buy a great Addin for your Home Server called Lights-Out http://www.wegotserved.com/2010/09/20/lightsout-v2/ that gives you the functionality plus additional features. However, I wasn’t willing to pay the license fee, plus I’m a geek and I thought there must be a way to do this with on board tools. The key component to get it working is this rundll32 call.

rundll32 powrprof.dll,SetSuspendState 0,1,0

It sets your computer to the configured suspend state. The 1 in the parameter list forces the sleep. Otherwise the sleep request can be rejected by any component or running software. You should also check whether the S3 mode works on your configuration. I my case a missing video driver caused that the S3 state wasn’t available. Here nice little tool to check your suspend states MCE StandBy Tool. Once you made sure that the suspend works on your Home Server, we can setup some tasks in the task scheduler.

First the one that puts our server to sleep. Open the Task Scheduler from Administrative Tools under the Start Menu

image

Now click the “Create Task…” action on the right side of the task scheduler and give the task a meaningful name. Also check the “Run whether user is logged on or not” radio button.

image

Next click on Triggers and add a new Trigger. In my case I wanna run the task on a schedule daily at 10 pm.

image

Now add the action to put the server to sleep under the Actions tab.  The full line for the arguments is powrprof.dll,SetSuspendState 0,1,0

image

Ok now we need to wake up the server in the morning. Therefor we don’t need a special program because the Task Scheduler already has the option to wake up a computer for a certain task. So lets add another Task.

image

Add a Trigger at 7 am.

image

Since an action is required, we just add an action that is doing nothing, like cmd.exe /c.

image

Now the important part for this task is to set the option “Wake the computer to run this task” under the Conditions tab.

image

If you wanna wake up the server out of band then you can use any of those Wake On LAN tools you can find on the internet.

Follow

Get every new post delivered to your Inbox.

Join 294 other followers