I want to create a variable in a batch file and I want to assign a path of a text file to to this variable. After that, I want to use this variable to copy that file. How can I do this?
Thank you,
The general idea is this:
SET filename=c:\path\to\file.txt
COPY "%filename%" c:\destination
Note the quotes around %filename%
: they are necessary to make the command work if the path or file name contains spaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With