Skip to content

Batch Script Creating Files

Learn how to create new files in Windows Batch Script using the redirection operator > and practical examples for file generation.

Creating Files

In Batch Script, the creation of a new file is done with the help of the redirection filter >. This filter can be used to redirect any output to a file.

Example

@echo off
echo "Hello">C:\new-file.txt

If the file new-file.txt is not present in C:\, it will be created with the previous command.

Navigation