This repository contains various batch scripts that I’ve written to automate repetitive day-to-day tasks, including file management and FTP uploads.
The scripts in this repository are designed to:
- Automatically find and copy the latest file in a specified folder.
- Upload files to an FTP server.
- Streamline daily operations by reducing manual work.
-
latest_file_to_ftp.bat
This script finds the most recent file in a specified folder and uploads it to a specified FTP server. -
copy_file.bat
This script copies a specific file from one folder to another.
This script automates the process of finding the newest file in a directory and uploading it to an FTP server. It’s particularly useful for automating file transfers for backups, reports, or any other regular uploads.
How it Works:
- The script identifies the most recent file in the specified directory based on its creation or modification date.
- It then connects to the FTP server using the provided credentials.
- The file is uploaded directly to the root directory (or another specified folder) on the FTP server.
Usage Instructions:
-
Set up the script by editing the following lines with your specific paths and FTP details:
set "source_folder=C:\Path\To\Your\Folder" set "ftp_server=your.ftp.server" set "ftp_username=yourusername" set "ftp_password=yourpassword"
-
Run the script by double-clicking
copy_to_ftp.bator using the command line:copy_to_ftp.bat
Example Output:
Newest file found: example_2024-08-21.xml
File uploaded successfully to your.ftp.server.