Windows Server

Running Dropbox on Windows Server…and keeping it running!

I manage an on-premises file server running Windows Server 2012r2 – It was built to serve OSX and Win10 clients via SMB – don’t worry I’ve already disabled SMB1 to prevent Cryptolocker/Randsomware from spreading!

In the event of a HDD failure, the server hosts the standard RAID setup with a warm spare WD Red Drive sitting ready. As an off-site backup solution for the files contained (NOT the Operating System, thats backed up via a different soloution) it was decided by ‘the powers that be’ to use Dropbox to sync the data to the ‘cloud’ – providing both web based access to files if really needed and a way for remote workers to get non-condifential data (permissioning is a bit tricky at the moment).

The offical word from Dropbox is that you can’t install Dropbox on Windows Server 2012… and its true – the client tells you it can’t – unless you run the installer in compatability mode (Windows 7).

Over the first few weeks of running with this setup I noticied the Dropbox Client would crash or stop for some reason (I did some digging but not enough to come to a full conclusion). As a workaround I crafted a batch file to monitor the Dropbox program and restart it in the event it crashes.

Heres the snippet below

@echo off
Set "MyApplication=C:\Program Files (x86)\Dropbox\Client\Dropbox.exe"
Set "MyProcess=Dropbox.exe"
Color 9B
Title Verification "%MyProcess%" by MichaelB
mode con cols=75 lines=2
tasklist /nh /fi "imagename eq %MyProcess%" 2>nul |find /i "%MyProcess%" >nul
If not errorlevel 1 (Echo "%MyProcess%" is running!) else (start "" "%MyApplication%")
ping -n 60 >nul 
goto start

You can edit the above and paste into your favourite text editor, Notepad will suffice – save as .bat and you are good to go! Once running you should see something long the lines of;

Windows Server
Michael Burdett
Web & App Developer