2026-07-30
File transfer between Linux and Windows environments can be automated with the WinSCP application and Windows batch files.
BackupVM831.bat file contents.
@ECHO OFF
COLOR 0C
ECHO SECURITY COPY
ECHO Data saved on virtual machine VM831 to be copied to external hard drive S:\S283.
ECHO BackupVM831.bat
ECHO.
PAUSE
SET winscpPath="C:\Program Files (x86)\WinSCP\winscp.com"
ECHO Copy files located in the /myusername/Documents/ folder.
PAUSE
%winscpPath% /ini=nul /command "open sftp://myusername:mypassword@192.168.56.131/ -hostkey=""ssh-ed25519 255 jxoFJSgvnIE+dW04Reg1VXKmx09Po+DgJDZBokLXWGM""" "synchronize local -delete S:\S283R152\VM831\myusername\Documents /home/myusername/Documents" "exit"
PAUSE
ECHO Copy files located in the /var/www/html/ folder.
PAUSE
%winscpPath% /ini=nul /command "open sftp://myusername:mypassword@192.168.56.131/ -hostkey=""ssh-ed25519 255 jxoFJSgvnIE+dW04Reg1VXKmx09Po+DgJDZBokLXWGM""" "synchronize local -delete S:\S283R152\VM831\html /var/www/html" "exit"
PAUSE
The management of back-up copies using well-programmed scripts means that the task can be carried out quickly and accurately.
My technical notes are not tutorials. They are reminders of commands to be executed from a terminal. I do not provide any explanation of the nature of the commands described in my documents. Do not execute them if you don’t understand the meaning of the commands. To avoid losing data or destabilising your workstation, it is preferable to test the commands from a virtual machine, with snapshots.
The names of directories and IP addresses must match the configuration of your workstation and peripherals.