Since I started in IT when DOS was considered an advanced technology I am almost embarrassed to have to ask for help with this, but since I have little hair left I guess I will swallow my pride and put this out there.
Without going into my normal painful detail; from a 2008 R2 server I need to automatically rename a directory on a mapped drive (Z: ) while adding the date to that folder and then create a new empty one with the same name as the original one I renamed. I am backing up folders from the server to the qb_copy folder.
Here is what I have done so far but it fails at the rename function. I cannot figure out why. The variables work, the wait time works and the new directory creation works. Just the rename fails with a syntax error. When the batch file is finished I should have a populated folder named QB_Copy_For_07-20-2014 (as of today’s date)
for /f “tokens=2-4 delims=/ ” %%a in (‘DATE/T’) do set cdate=%%a-%%b-%%c
ren z:qb_copy z:%var1%%cdate%
ping 126.96.36.199 -n 1 -w 6000>NUL
What am I doing wrong?
You must be logged in to reply to this topic.
Create a free account today to participate in forum conversations, comment on posts and more.