Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

So i googled about a bit and found the following command to drop into a batch file to copy files about, but it doesn't quite work.

 

xcopy c:\Hornresp\* c:\Hdata\%date:~0,3%\* /Y /Q /S

 

I get the following error (in attachment);

 

Many thanks to anyone who can shed light on why this might not be working for me.

Untitled.png

Posted (edited)

Your date formatting isn't correct I'd say. What is it you're trying to show with that?

 

Currently you're taking the first 3 letters, aka 02/ 02 is being added, then your / is making the next part a switch. I'm assuming you either want 0,2 or something totally diff? :D

 

Steve

Edited by Steve21
Posted
The following will give you the date in YYYY-MM-DD format if that's of any use?

 

%date:~6,4%-%date:~3,2%-%date:~0,2%

 

awesome this worked a treat - thanks guys.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...