2
My question may have answered someway or other but unfortunately I did not get the exact answer that I was looking for. Here is what I'm trying to do-
- create a folder on pc1,
c:\temp1
- map a network drive that contains source folder/files -
\\server1\directory1folder01...10000
( each day system creates either just single or multiple folders but with unique time stamp - copy the latest folder that was created in the PC1 i.e.
c:\temp1
This is what I have written in the batch file:
+++++++++++++++++++++++++++++++++
@echo off
mkdir c:\temp1
echo mapping drive...
net use Y:\\server\directory1 /user:myusername mypassword
echo copying files/folders into c:\temp1....
xcopy Y:\ c:\temp1 /s/e/d:"%DATE%"
+++++++++++++++++++++++++++++++++
It creates the c:\temp1
and maps the drive but can't copy.
Can anyone please help me here?
Kam
Which question are you referring to? Did you already ask a similar question? – RedGrittyBrick – 2012-09-14T16:10:05.720
Do you get any error from xcopy? – Nifle – 2012-09-14T17:21:48.187
Note that you don't need /s if you have /e. Does no harm, though. – Isaac Rabinovitch – 2012-09-14T17:31:05.137
have you tested the xcopy statement by itself to see if it works? – Keltari – 2012-09-14T17:39:06.440
Can you give us the exact folder name in order to help format the command correctly? – CharlieRB – 2012-09-14T17:59:33.910