Navigation

Windows

Batch date time backup

Zálohování:

\\server\TS\tel-seznam.xls

@echo off
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
rem set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
set datestr=%d:~6,4%%d:~3,2%%d:~0,2%
set timestr=%t:~0,2%%t:~3,2%

SET NOW=%datestr%-%timestr%

md \\server\TS\_Zaloha\%NOW%

echo %username% - %NOW% >> \\server\TS\_Zaloha\log.txt
copy \\server\TS\tel-seznam.xls \\server\TS\_Zaloha\%NOW%\
copy \\server\TS\_Zaloha\log.txt \\server\TS\_Zaloha\%NOW%\
rem pause

Pages

Subscribe to Windows