Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's some simple code you could run after the xcopy to set the subdir destination folder dates and times to the same as the source. Hope this is helpful. </p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Copy { class CopyDirTimestamps { public static bool CopyTimestamps( string sourceDirName, string destDirName, bool copySubDirs) { try { CopyForDir(sourceDirName, destDirName, copySubDirs, false); return true; } catch (Exception) { return false; } } private static void CopyForDir( string sourceDirName, string destDirName, bool copySubDirs, bool isSubDir) { DirectoryInfo dir = new DirectoryInfo(sourceDirName); DirectoryInfo[] dirs = dir.GetDirectories(); // If the source directory does not exist, throw an exception. if (!dir.Exists) { throw new DirectoryNotFoundException( "Source directory does not exist or could not be found: " + sourceDirName); } if (!Directory.Exists(destDirName)) return; DirectoryInfo destDir = new DirectoryInfo(destDirName); // If copySubDirs is true, copy the subdirectories. if (copySubDirs) { foreach (DirectoryInfo subdir in dirs) { // Create the subdirectory. string temppath = Path.Combine(destDirName, subdir.Name); // Copy the subdirectories. CopyForDir(subdir.FullName, temppath, copySubDirs, true); } } if (isSubDir) { destDir.CreationTime = dir.CreationTime; destDir.LastAccessTime = dir.LastAccessTime; destDir.LastWriteTime = dir.LastWriteTime; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload