I needed a way to get a MYOB file from one site to another, and have the users at the 2nd site be able to access the files easily, no digging around in ZIP folders and the likes.

The Remote site uses BackupAssist to ZIP the files, then FTP them to the main office, then the script does the rest

This script extracts files from a ZIP file, extracts them to a location, moved the ZIP file to a “holding bay” then removed all older files from the “holding bay”. The only other thing you need is WINRAR.

Rem Set path for Winrar
set path=”C:Program FilesWinRAR”;%path%
Rem Change to location of files
E:
cd “dataRichmondSeymour Backupmyob”
Rem check to see if ZIP file is there
if exist “ FTP Landing PATH*.zip” (
  WinRAR e *.zip *.myo “Location wanted on server” -o
  ) else ( goto end
  )
  

Rem move used file to folder
move /y *.zip “Path to Holding bay
rem clean up use files folder
forfiles /p “path to holding bay” /d -7 /m *.* /C “cmd /C del @path /Q”

:end

Another quality script by me 🙂

« »