# Solved: Batch Files - Declaring Variables



## DoubleHelix

I'm having trouble remembering how to declare a variable in a batch file. I've searched the web for a while, but I'm hoping someone knows this off the top of their head. 

Here's what I tried:

SET LOCATION1 = C:\Folder2
COPY C:\folder1\file1.txt %LOCATION1%\file.txt

The purpose is to copy the file file1.txt from C:\Folder1 to C:\Folder2.


----------



## Squashman

Do you have spaces before and after the "=" sign. If so, remove them.


----------



## DoubleHelix

That worked. Thanks.


----------

