Batch Script - Creating Files


Advertisements

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. Following is a simple example of how to create a file using the redirection command.

Example

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

Output

If the file new.txt is not present in C:\, then it will be created with the help of the above command.

batch_script_functions.htm
Advertisements