Windows 10: Batch: change target directory date after xcopy

Discus and support Batch: change target directory date after xcopy in Windows 10 Backup and Restore to solve the problem; I use this command to make a weekly back up my personal files: Code: xcopy C:\all\* Z:\Allbak\* /C /D /E /I /W /Y[/quote] Works fine but how can I... Discussion in 'Windows 10 Backup and Restore' started by tcebob, Jan 17, 2018.

  1. tcebob Win User

    Batch: change target directory date after xcopy


    I use this command to make a weekly back up my personal files:
    Code: xcopy C:\all\* Z:\Allbak\* /C /D /E /I /W /Y[/quote] Works fine but how can I change the date attribute of the Allbak directory to the current date?

    :)
     
    tcebob, Jan 17, 2018
    #1
  2. Alphagrey Win User

    Why can't I copy a file from a USB drive even when giving Admin permission

    I have the same problem. My solution is to use Microsoft's Windows 10 xcopy command line command.

    xcopy /E source_path target path

    The following command line copies all directories (empty or not) from E:\AOP directory on my USB drive to the current directory.

    xcopy /E E:\AOPdir .
     
    Alphagrey, Jan 17, 2018
    #2
  3. Beeatrice Win User
    How to temp set date format in a batch file?

    I have a batch file for backing up my important files. I save them to my hard drive then later xcopy Mybkup to a CD. It works great if the date format is yyyy-MM-dd. I would like to set it in the batch file only. This is basically one of the lines in my
    .bat file. If I change the format it messes up th file structure of my backup.

    XCOPY "C:\...\Doc" "C:...\Mybkup\BKUP%DATE%\Doc\" /S /V /I /G /R /K /Y
     
    Beeatrice, Jan 17, 2018
    #3
  4. Batch: change target directory date after xcopy

    XCOPY (and ROBOCOPY) don't seem to have any way to update the timestamp to the current time.

    You'll have to use another utility like BulkFileChanger: Change date/time/attributes of multiple files , which can be used from the command prompt as well as the GUI.

    Edit: Sorry, I think I misread the OP. Do you just want to change the modified date of the Allbak\ folder but leave the timestamps of the files the same? If so, then I don't believe BulkFileChanger will work. If you have access to the Unix "touch" command (e.g. through Cygwin or MSYS) then that's the simplest way.
     
    PolarNettles, Jan 17, 2018
    #4
  5. tcebob Win User
    Yes, I want to re-date the backup directory only, not the contents. Most backup programs do this with incremental backups so I hoped I could find a way.
     
    tcebob, Jan 17, 2018
    #5
  6. If you don't mind installing something, touch.exe is part of Cygwin coreutils.


    Batch: change target directory date after xcopy [​IMG]


    Otherwise, if you can move to PowerShell then you can also do:

    (Get-Item -Path $folder).LastWriteTime = (Get-Date)


    Batch: change target directory date after xcopy [​IMG]


    Edit: You can also call the PowerShell command from CMD like:
    Code: powershell -Command "(Get-Item -Path c:\temp).LastWriteTime = (Get-Date)"[/quote]
     
    PolarNettles, Jan 17, 2018
    #6
  7. tcebob Win User
    Thanks for the suggestions. I found a program, Attribute Changer which inserts options to the context menu and works quite well. Not automatic but easy and quick. Download at www dot petges dot lu, which is the author's home page. (can't insert verbatim address because Windows automatically switches it to a non-download site.)
     
    tcebob, Apr 5, 2018
    #7
Thema:

Batch: change target directory date after xcopy

Loading...
  1. Batch: change target directory date after xcopy - Similar Threads - Batch change target

  2. robocopy to NAS affecting target directory such that it is Hidden on macOS

    in Windows 10 Gaming
    robocopy to NAS affecting target directory such that it is Hidden on macOS: Have a WIndows 10 and a MacOS Monterey 12.6 system connected through an ethernet switch to a Synology DSM7 NAS box. I'm using robocopy in a .cmd script that I schedule nightly to backup windows volumes other than C: to the NAS. I can see the files are being backuped up OK...
  3. robocopy to NAS affecting target directory such that it is Hidden on macOS

    in Windows 10 Software and Apps
    robocopy to NAS affecting target directory such that it is Hidden on macOS: Have a WIndows 10 and a MacOS Monterey 12.6 system connected through an ethernet switch to a Synology DSM7 NAS box. I'm using robocopy in a .cmd script that I schedule nightly to backup windows volumes other than C: to the NAS. I can see the files are being backuped up OK...
  4. xcopy directory problem

    in Windows 10 Network and Sharing
    xcopy directory problem: In Windows 10 I open cmd and entered d: mkdir "backup of disk e" cd "backup of disk e" xcopy /e/i/h/c f:/ . everything seemed to work fine. However, the directory does not show in the finder, nor in cmd using dir. If I do dir "backup of disk e" I do get a listing...
  5. Target directory expands when using drag and drop

    in Windows 10 Network and Sharing
    Target directory expands when using drag and drop: Ordinarily, this isn't a problem, but I am moving a lot of files at this time. I drag the file over to the target, and often, just as I turn loose of the mouse button the target directory expands and my file lands in one of the subdirectories. I then waste time trying to...
  6. Is it Possible to Batch Change Date & Time of File

    in Windows 10 Ask Insider
    Is it Possible to Batch Change Date & Time of File: [ATTACH] I have about 10,000 or so files that are either .mp4 or .jpg that all say they were created on the same day. I have all the timestamps in the filename in [year,month,day_hour,min,second.jpg/mp4] format. How can I transfer the date in the filename to metadata?...
  7. Batch file to current date and time

    in Windows 10 Customization
    Batch file to current date and time: Dear expert. Can you help me to batch file to change system date and time to current? Best regards, https://answers.microsoft.com/en-us/windows/forum/all/batch-file-to-current-date-and-time/2c75b187-3561-4604-b9b5-218db993a6f6
  8. Batch backup & change write date

    in Windows 10 Support
    Batch backup & change write date: I use a batch file to back up a directory, updating the same directory each week for a month. I then rename it to include the date "Allback180822" and archive it. Code: REM Backup of C:\All to Z:\Allbak xcopy C:\all\* Z:\Allbak\* /C /D /E /I /Y echo Done! cmd /k ::keep window...
  9. Enable Or Disable Change System Time And Date Using Batch file

    in User Accounts and Family Safety
    Enable Or Disable Change System Time And Date Using Batch file: hi, i want to disable the change time and date in windows ten using batch file, i am using this script to show and hide hidden file Code: @echo off REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V Hidden /T REG_DWORD /D 0 /F taskkill /f /im...
  10. Xcopy syntax for multiple source directories

    in Windows 10 Support
    Xcopy syntax for multiple source directories: can someone show me a sample xcopy command to copy C:\Directory1 and C:\Directory2 to a destination directory H:\DestinationDirectory? 88324