How to setup Dropbox as a Service on Windows Server 2012 R2

This is how to setup Dropbox as a Windows Service so that you do not have to leave a user account logged onto your server for Dropbox to sync files. This can also work for Server 2008 R2.

Pro Tip: If you set this up and it stops working later on, just download and install the latest Dropbox software and then run through the steps again and it will work. Make sure to delete the “service” first. I had to remove it via REGEDIT. Google it if you are not sure how to remove a “service”.

Step 1: Exit from Dropbox software

Make sure to exit out of the Dropbox software. This can be done by Right Clicking the notification on the taskbar and choosing to EXIT from the program.

Step 2: Download and install Microsoft Windows 2003 Resource Kit

Download and install Microsoft Windows 2003 Resource Kit: https://www.microsoft.com/en-au/download/details.aspx?id=17657

Step 3: Copy srvany.exe to the root of the Dropbox program folder

Copy the file: “srvany.exe” directly into the following location: C:\Program Files (x86)\Dropbox\

Step 4: Run the following in Command Prompt

Run the following in Command Prompt:

sc create Dropbox binPath= “C:\Program Files (x86)\Dropbox\srvany.exe” DisplayName= “Dropbox Service”

Step 5: GOTO Properties of “Dropbox Service”

Launch “services.msc” and Right Click “Dropbox Service” and choose Properties.

Step 6: Set Log On credentials

Service_Logon_Account_for_Dropbox.png

GO TO “Log On” Tab. Choose the Windows/Local Computer account that usually logs into the Windows session to launch Dropbox. HINT: This is the same account that saved the logon credentials in the Dropbox software to launch at startup and sync when you log in.

Step 7: Dont forget to set the Startup Type

Set_Service_to_Automatically_Run.png

Make sure to set Startup type to: Automatic

Step 8: Let’s run some Powershell scripts

Run the following Commands in Powershell:

New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dropbox\Parameters

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dropbox\Parameters -Name Application -PropertyType String -Value “C:\Program Files (x86)\Dropbox\Client\Dropbox.exe”

Step 9: Start the “Dropbox service”

Go back to Services.msc and start the “Dropbox Service”.

26 Spice ups

I have never used srvany.exe from the 2003 toolkit. Do you know the difference between using that, and, just using powershell to create a new service? Will the dropbox.exe not run as the actual service? Did you try it that way?

Edit: I tried it, and it failed. :stuck_out_tongue: Too bad there isn’t a more modern version of srvany.exe; although, hey, it works fine! But it’s just sort of janky that i’m installing a toolkit that is probably… um 13 years old.

@Wayne_Byarlay …Dropbox.exe will not run as an actual service without this procedure. Trust me, I’ve tried.

What OS are you trying to do this on? I did it on 2012 R2.

Thank you for this it is working great! I am running 2012 R2. The only question that I have is how to monitor Dropbox status? Can you get the icon in the tray of the login user assigned in the service? I suppose I could stop the server and run dropbox locally and then stop the local copy and restart the service? But am interested if you have another solution. Thanks,

@nolancarl, being that its a service, you will not get the icon anymore. Why do you need this?

Would like a way to check dropbox status i.e. the icon in the tray. But would also like a way to pause and work the selective sync. Mostly would just like a way to insure it is running and not stuck.
Thanks,

As long as you see the service running, then Dropbox is active. If you still have a need to physically look at the process, then you can still launch the program manually and work with the files as needed. Personally, I just launch the Dropbox website and work from their web interface. That way there is no way I can mess something up locally with the local services.

Nice write-up. This also works with Win Server 2016, in case anyone is curious.

Dropbox is designed to be an application ran by an actual user. I’ve called Dropbox support on this and they just say run it at your own risk because it’s not supported on servers and they cannot guarantee that it will work because it’s not supported. I’ve found several workarounds though that may help you out. First and foremost because it’s NOT SUPPORTED ON WINDOWS SERVER, proceed at your own risk knowing that IT WILL occasionally not work and may need a reboot or even a re-installation.

A paid solution is boxifier, which does exactly the same result as above to wrap it as a system service.
The downside is that the configuration of the client MUST be done as the installed user, then converted to a service. If you need to make a change, then de-register the service and run it as the user, make the changes and then convert it back to running as a service. This is the exact REQUIRED method to make changes like selective sync even if you follow the instructions above making your own service.

The next option is to write your own program to do what you want it to do utilizing Dropbox using their latest API. The downside to this is that there may be a learning curve to write such a program plus the time cost to do such a thing.

There are other UNSUPPORTED options that WORK GREAT (So far).
One is to use dropbox_uploader.sh and run a dedicated instance of Linux in a VM or run within Cygwin on Windows, but it can be a pain to get this working on Windows depending on what you want it to do. check out GitHub - andreafabrizi/Dropbox-Uploader: Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service. for more info on the script. If anyone would be so kind to convert or create this functionality using Powershell, I know the community would appreciate it. NOTE: This method you do NOT need to install Dropbox, but rather design scripts to push, pull, email, etc. based on whatever logic you design.
e.g. After a file is copied to a folder, then have it upload the file to a static Dropbox path and then send an email to the users that need to work on the new file that was provided.

The second totally unsupported option that works great so far is to run Synology’s DSM in a VM and setup Dropbox sync inside of DSM. This can be done using xpenology Loading...

SUPPORTED OPTIONS
The only other way I know that may have some support options is to actually buy a Synology NAS and drives and install the Dropbox sync app. I don’t know if Dropbox themselves actually support this or how good Synology’s support on using the Dropbox app actually is.

The last option I know of is to dedicate a Linux VM for whatever purposes and install Dropbox and use the cli.
https://www.dropbox.com/en/help/9192

There may be some options now with Powershell or DOS, but they would not be supported by Dropbox support. If anyone else has used some other scripts or programs please share your feedback.

@brad2618, thanks for the thorough analysis for this…but, this was just a “quick and dirty” approach of making Dropbox work right away as a service. Your efforts are certainly appreciated as it gave me some different options to think about in the future.

You bloody legend. Got sick of constantly forgetting to check if DB was running, and it has a bad habit of stopping on Server 2012 R2. Thanks!

Anytime @karnophage. I try to create KB articles of things that I have a tough time trying to Google. This way we can all benefit.

Brilliant, thanks Alberto!
I found i also had to update the ‘Group Policy Management’ because i kept getting an error ‘Start Service Failed with Error 1069’ logon error.
Article on how to update this is here:

Thanks

@jackgriffin, correct. I did not have this problem because I forgot to mention that I altered the properties of this service to run with a domain account I had already setup with local service rights.

although i do use dropbox, not sure if i want this running for everyone across the domain

Nice job mate!, works fine on win server 2008 R2 standard.
I just shared a dropbox dir on the network so the workers can acces to the files and migrate it them to the new place…

@peter, this is not running for everyone across the domain…just on the one server you chose.

ONE MILLION of THANKS.
It worked like a charm in my Azure VM win Server 2012 R2
By the way I’ve joined this community. :wink:

Brilliant! Thanks for the how-to. It worked like a charm on the first try with no hiccups on Server 2016.

Great info, thanks for sharing
B R A V O