Skip to content

Instantly share code, notes, and snippets.

@djg
Created October 1, 2012 23:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djg/3815097 to your computer and use it in GitHub Desktop.
Save djg/3815097 to your computer and use it in GitHub Desktop.
Perforce Backup
@ECHO OFF
SETLOCAL EnableDelayedExpansion
SET CL=%1
IF "_%CL%_"=="__" SET CL=default
SET "r=%__CD__%"
FOR /F "tokens=1,5,6 delims=# " %%a IN ('p4 opened -c %CL%') DO (
FOR /F "tokens=3" %%j IN ('p4 where %%a') DO (
SET p=%%j
7z u -tzip %%b%%c !p:%r%=! > nul
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment