robocopy command for directory time stamp copy

J

J David Ellis

could someone post the command-line string that will cause
robocopy to copy folder timestamps under windows xp sp2 ntfs?

for example: robocopy c:\a c:\b /mir [additional options?]

where c:\a contains several subdirectories

this is not a question about copying file timestamps; it's
about ***folder*** timestamps, particularly folder 'date
modified' and folder 'date created'.

--david
 
U

Uncle Grumpy

could someone post the command-line string that will cause
robocopy to copy folder timestamps under windows xp sp2 ntfs?

NO.

WTF are you doing asking a question about Robocopy in a forum that is
for discussing WINDOWS XP operating system issues??
 
P

Pegasus \(MVP\)

J David Ellis said:
could someone post the command-line string that will cause robocopy to
copy folder timestamps under windows xp sp2 ntfs?

for example: robocopy c:\a c:\b /mir [additional options?]

where c:\a contains several subdirectories

this is not a question about copying file timestamps; it's about
***folder*** timestamps, particularly folder 'date modified' and folder
'date created'.

--david

Sometimes Uncle Grumpy not only lives up to his name
but he also misses his mark by a long shot.

It appears that robocopy will not preserve the date stamp
of a folder. However, you do the following:
1. Use robocopy to copy a folder, complete with subfolders.
2. Compile a list of all folder dates.
3. Use a "touch" utility to apply the folder dates to the target folder.

The batch file below will do just that. It makes use of
DirDate.exe, which you can download from
http://www.datamystic.com/buy/dirdate.html.
DirDate is not free but you might find other touch tools that are.

The batch file relies on drive T: not being used for anything
else. You must remove all # characters - they only serve to
mark the beginning of each line. Do not retype the file - use
copy & paste instead.

#@echo off
#set first=true
#set DDate=zzz
#set Source=d:\temp
#set Target=d:\New
#set TempFile=d:\dir.tmp
#set TouchTool=C:\Program Files\DataMystic\DirDate\dirDate.exe
#if exist d:\Touch.bat del d:\Touch.bat
#
#robocopy "%Source%" "%Target%" *.* /s
#
#subst T: "%Source%"
#dir T:\ /s /ad /tw | findstr "Directory .." > "%TempFile%"
#for /F "delims=" %%a in ('type "%TempFile%"') do call :Sub %%a
#subst T: /d
#
#subst T: "%Target%"
#call d:\Touch.bat
#subst T: /d
#
#goto :eof
#
#=============================
#:Sub
#set parms=%*
#if %parms:~0,3%==Dir set Dir=%parms:~13%
#if not %parms:~0,3%==Dir set DDate=%parms:~0,10%
#if not %DDate%==zzz (
# if not %first%==true echo "%TouchTool%" Date=%DDate% "%Dir%" >>
d:\Touch.bat
# set first=false
# set DDate=zzz
#)
 
J

J David Ellis

Pegasus said:
J David Ellis said:
could someone post the command-line string that will cause robocopy to
copy folder timestamps under windows xp sp2 ntfs?

for example: robocopy c:\a c:\b /mir [additional options?]

where c:\a contains several subdirectories

this is not a question about copying file timestamps; it's about
***folder*** timestamps, particularly folder 'date modified' and folder
'date created'.

--david

Sometimes Uncle Grumpy not only lives up to his name
but he also misses his mark by a long shot.

It appears that robocopy will not preserve the date stamp
of a folder. However, you do the following:
1. Use robocopy to copy a folder, complete with subfolders.
2. Compile a list of all folder dates.
3. Use a "touch" utility to apply the folder dates to the target folder.
<snip>
Having flunked the Robocopy folder-timestamp quest, I'm
relieved to get confirmation that Robocopy cannot copy
folder date/time.

Retired now, I haven't looked at batch-file language for
many years. This is a good chance to experiment with the
recently discovered Notepad2.exe and get reacquainted with
the command line.

Thank you very much for your thoughtful and comprehensive
reply.

BTW, your email address is far more creative than mine. And
Uncle Grumpy's needs work. :=)
 
P

Pegasus \(MVP\)

J David Ellis said:
Pegasus said:
J David Ellis said:
could someone post the command-line string that will cause robocopy to
copy folder timestamps under windows xp sp2 ntfs?

for example: robocopy c:\a c:\b /mir [additional options?]

where c:\a contains several subdirectories

this is not a question about copying file timestamps; it's about
***folder*** timestamps, particularly folder 'date modified' and folder
'date created'.

--david

Sometimes Uncle Grumpy not only lives up to his name
but he also misses his mark by a long shot.

It appears that robocopy will not preserve the date stamp
of a folder. However, you do the following:
1. Use robocopy to copy a folder, complete with subfolders.
2. Compile a list of all folder dates.
3. Use a "touch" utility to apply the folder dates to the target folder.
<snip>
Having flunked the Robocopy folder-timestamp quest, I'm relieved to get
confirmation that Robocopy cannot copy folder date/time.

Retired now, I haven't looked at batch-file language for many years. This
is a good chance to experiment with the recently discovered Notepad2.exe
and get reacquainted with the command line.

Thank you very much for your thoughtful and comprehensive reply.

BTW, your email address is far more creative than mine. And Uncle Grumpy's
needs work. :=)

The EMail address you see is ficticious. No need to let
spammers harvest my real address from newsgroups.

The batch file I gave you uses some advanced commands.
Feel free to ask if you need an explanation.

I had not been aware of notepad2.exe but it looks like a
nice product worthy of serious consideration.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top