Search found 4 matches

by mlawton1986
22 Mar 2016 10:27
Forum: DOS Batch Forum
Topic: Xcopy not changing modified date
Replies: 6
Views: 14257

Re: Xcopy not changing modified date

I worked it out... turns out I have to be in the directory...

Therefore I simply added:

Code: Select all

cd %SRC_LOC%


before the copy...
by mlawton1986
22 Mar 2016 09:34
Forum: DOS Batch Forum
Topic: Xcopy not changing modified date
Replies: 6
Views: 14257

Re: Xcopy not changing modified date

Hello,

OK, here is the relevant bits of my code:

Code: Select all

SET SRC_LOC=C:\ML\From\
SET DATE=%date:~0,4%%date:~4,2%%date:~6,2%

for %%X IN (%SRC_LOC%Tester_%DATE%_*) do (
copy /b %%X +,,
)


But the modified date does not change.
by mlawton1986
21 Mar 2016 12:51
Forum: DOS Batch Forum
Topic: Xcopy not changing modified date
Replies: 6
Views: 14257

Re: Xcopy not changing modified date

The file copies fine so nothing wrong with the syntax. The problem is that it keeps the original modified timestamp in the destination folder. I need that to be updated when it copes. E.g. If I manually copy and paste the file to the directory it updates the modified date to now... I'd of thought x ...
by mlawton1986
21 Mar 2016 10:57
Forum: DOS Batch Forum
Topic: Xcopy not changing modified date
Replies: 6
Views: 14257

Xcopy not changing modified date

Hi, In a batch script 'm doing a: XCOPY <file> <destination> and I expected the modified date of the file in the destination folder to be the time the command is executed but it is keeping the original modified timestamp... I've tried doing a: copy /b <file> +,, before the XCOPY to attempt to change...