I want to create a variable in a batch file, and I want to assign a text file path to this variable. After that, I want to use this variable to copy this file. How can i do this?
Thanks,
The general idea is this:
SET filename=c:\path\to\file.txt COPY "%filename%" c:\destination
Pay attention to the quotes around %filename% : they are necessary to make the command work if the path or file name contains spaces.
%filename%