*.bat

# Изпълним файл под Windows за архивиране на потребителска папка върху мрежово устройство.

@ECHO OFF

net use O: /D
net use O: \\share1\user1 password1 /USER:user1
for /F "tokens=2" %%i in ('date /t') do set currentdate=%%i
SET Dt=%currentdate%
SET SrcFolder=O:\User1Files
SET DestPath=F:\BackuP
"C:\Program Files\7-Zip\7z" a "%DestPath%\User1Files1-%Dt%.7z" "%SrcFolder%"


net use Q: /D
net use Q: \\share2\user2 password2 /USER:user2
for /F "tokens=2" %%i in ('date /t') do set currentdate=%%i
SET Dt=%currentdate%
SET SrcFolder=Q:\.
SET DestPath=F:\BackuP
"C:\Program Files\7-Zip\7z" a "%DestPath%\UseFiles2-%Dt%.7z" "%SrcFolder%"