troubleshooting Question

Bat file to copy from a network unc path

Avatar of SQLSearcher
SQLSearcher asked on
Windows BatchMicrosoft Legacy OS
6 Comments1 Solution4875 ViewsLast Modified:
Hello Experts Exchange
I am trying to write a bat file that will copy files from a folder that is a UNC path.

I have a bit of the script ready that give me the month. Which I put into a variable called mydate.


For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=\%%a\)

Xcopy "\\ntserver2\data"%mydate%"AC4\Moulding\*.*" "Y:\GGR\moulding"

Does anyone know how I can get this to work as the XCopy line does not work.

Regards

SQLSearcher
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros