Skip to content

Instantly share code, notes, and snippets.

@agross
Last active December 10, 2015 20:59
Show Gist options
  • Save agross/4492241 to your computer and use it in GitHub Desktop.
Save agross/4492241 to your computer and use it in GitHub Desktop.
@echo off
if %1.==. goto :usage
rem Pass second parameter to override subdir in Dropbox folder.
if %2.==. (
set SUBDIR=%~n1
) else (
set SUBDIR=%~2
)
set DROPBOX_ROOT=d:\Dropbox
set DROPBOX_TARGET=%DROPBOX_ROOT%\%SUBDIR%
echo %~f1 == %DROPBOX_TARGET%
set CHOICE=nothing
echo (Q)uit, (Return) moves this folder to Dropbox
set /P CHOICE=
if /i "%CHOICE%"=="Q" goto :quit
robocopy "%~f1" "%DROPBOX_TARGET%" /EFSRAW /MIR /DCOPY:T /MOVE
runas /user:%USERDOMAIN%\Administrator "cmd /c mklink /d \"%~f1\" \"%DROPBOX_TARGET%\""
pause
:usage
echo No parameters given. Pass the folder to move to Dropbox as the first parameter.
:quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment