Batch File - var wont work...

Trying to create a batch file to backup my save games but I cant get the variable to work…

I have


set var = E:\Game Saves

# Backup Game Save Folder
robocopy "C:\Users\Chris\Saved Games" "%var%\Users\Chris\Saved Games" /E /Z

when running the script from root of E, it just creates Users in E :frowning: Where am I going wrong?

quotes around the var setting ?

Eg: set var = “E:\Game Saves”

I concur, needs the quotes

…and quite possibly needs to be

set var = "E:\\Game Saves"

# Backup Game Save Folder
robocopy "C:\\Users\\Chris\\Saved Games" "%var%\\Users\\Chris\\Saved Games" /E /Z

DT.

Neither work I’m afraid :frowning: maybe robocopy cant take variables…

never come across robocopy before… had a look at “xcopy /?” ?

robocopy is standard in Vista and Windows 7 and can be downloaded in XP from Windows. It’s better at directory copying apparently.

Getting the var isn’t really an issues, just means I cant change the save location as easily. Never mind.