Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- set sourcePath=C:\Program Files\Labtech\Logs
- set destPath=%WINDIR%\Temp
- set destFilePrefix=LTLogsForAcronis_
- REM FTP Settings
- set uploadToFTP=YES
- set ftpServer=myFTPServer
- set ftpUser=myUsername
- set ftpPass=<password>
- set ftpPath=Log Snapshots/
- REM code below this line
- set hh=%time:~-11,2%
- set /a hh=%hh%+100
- set hh=%hh:~1%
- set stampDateTime=%date:~10,4%%date:~4,2%%date:~7,2%T%hh%%time:~3,2%%time:~6,2%
- set destFilename=%destFilePrefix%%stampDateTime%.zip
- IF EXIST "%destPath%\%destFilename%" EXIT /B 1
- powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem';[IO.Compression.ZipFile]::CreateFromDirectory('%sourcePath%', '%destPath%\%destFilename%'); }"
- IF NOT EXIST "%destPath%\%destFilename%" EXIT /B 1
- IF NOT DEFINED uploadToFTP EXIT /B
- DEL /Q "%destPath%\curl.*"
- powershell.exe -nologo -noprofile -command "& { (New-Object Net.WebClient).DownloadFile('http://www.paehl.com/open_source/?download=curl_761_0.zip','%destPath%\curl.zip');(new-object -com shell.application).namespace('%destPath%').CopyHere((new-object -com shell.application).namespace('%destPath%\curl.zip').Items(),16); }"
- IF NOT EXIST "%destPath%\curl.exe" EXIT /B 1
- "%destPath%\curl.exe" -T "%destPath%\%destFilename%" "ftp://%ftpServer%/%ftpPath%%stampDateTime%.zip" --user %ftpUser%:%ftpPass%
- DEL /Q "%destPath%\curl.*"
- DEL /Q "%destPath%\%destFilename%"
- EXIT /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement