Last active
December 10, 2015 20:59
-
-
Save agross/4492241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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