-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.bat
More file actions
24 lines (18 loc) · 792 Bytes
/
export.bat
File metadata and controls
24 lines (18 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@ECHO OFF
SET mypath=%~dp0
setlocal EnableDelayedExpansion
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
if "%%B" NEQ "" (
SET /A FDATE=%%F*10000+%%D*100+%%A
SET /A FTIME=%%B*10000+%%C*100+%%E
)
)
SET yyyymmdd=!FDATE!
echo Export Helper v0.1.2 @helloroy 20140219
echo =======================================
echo Export files and folders in : %mypath:~0,-1%
SET /P maxage=Modified date after / equal : (default %yyyymmdd%)
IF "%maxage%"=="" SET maxage=%yyyymmdd%
set exportpath=export_%maxage%
IF exist %exportpath% ( echo %exportpath% exists ) ELSE ( mkdir %exportpath% )
robocopy %mypath% %exportpath% /maxage:%maxage% /S /XF %mypath:~0,-1%\%~nx0 /XD %mypath:~0,-1%\%exportpath%