Join Exercism’s Batch Script Track for access to 20 exercises with automatic analysis of your code and personal mentoring, all 100% free.
@echo off
setlocal enabledelayedexpansion
set /p backupDir=Enter backup directory:
if not exist "!backupDir!" mkdir "!backupDir!"
for %%f in (*.txt) do (
set timestamp=!date:~-4,4!!date:~-10,2!!date:~-7,2!_!time:~0,2!!time:~3,2!
copy "%%f" "!backupDir!\%%~nf_!timestamp!%%~xf"
)
echo Backup complete
Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.
Given a DNA string, compute how many times each nucleotide occurs in the string.
Given a word, compute the Scrabble score for that word.
Create a sentence of the form "One for X, one for me.".
Batch scripting is simple and accessible for beginners.
Batch scripts run on any Windows system without modification.
Batch scripts can prompt for and handle user input dynamically.
Batch scripting handles a variety of automation tasks effectively.
Automate and manage tasks efficiently with Batch scripting.
Batch scripts run reliably for consistent task automation.
Every language has its own way of doing things. Batch Script is no different. Our mentors will help you learn to think like a Batch Script developer and how to write idiomatic code in Batch Script. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Batch Script - they'll help you discover the things you don't know that you don't know.
Learn more about mentoringThe Batch Script track on Exercism has 20 exercises to help you write better code. Discover new exercises as you progress and get engrossed in learning new concepts and improving the way you currently write.
See all Batch Script exercisesThe best part, it’s 100% free for everyone.