

InterviewSolution
Saved Bookmarks
1. |
Solve : batch 2 change files's created date 2 modified date? |
Answer» <html><body><p>I <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> a batch file to copy a files modified date to the created date.Don't think this is possible. There is no native way to do this in batch so you'll need a 3rd party program called <em>Touch</em>. You can read about it <a href="http://malektips.com/file-touch-dos-windows-file-creation-modification-access.html">here</a> and if it seems helpful follow the link to the <a href="http://www.wintestgear.com/products/FileTouch/FileTouch.html">download</a><br/><br/>The DateCreated field in <em>VBScript</em> is read-only. If you have access to <em>Powershell </em>you can do this in a one-liner.<br/><br/>Good luck. Thank you for your quick response! The program that you mentioned will change all selected file dates to a fixed date. That isn't what I need.<br/><br/>The issue is that I just bought a new phone. All of my pictures {487 of them) were transferred to the new phone, but they all are out of order. I found that all the transferred files had the same date and time which is the time that the files were xfered. The file dates are showing up correct. Looking further, the file's date is the modification date and the creation date is the date the files were transferred. It appears that the phone uses the creation date to sort the pictures, thus no sorting of the xfered files. <br/><br/>If anyone has any other ideas, please let me know.If you transfer files to a phone, and the phone gives them a creation date corresponding to when you transferred them, why do you think a batch file run on a computer is going to be any use?<br/><br/>I am <a href="https://interviewquestions.tuteehub.com/tag/transferring-1425726" style="font-weight:bold;" target="_blank" title="Click to know more about TRANSFERRING">TRANSFERRING</a> to a MicroSD Card. It apparently did the same thing when I transferred the pictures to the computer the first time.<br/><br/>Is there a way to recopy the files while modifying the <a href="https://interviewquestions.tuteehub.com/tag/create-427332" style="font-weight:bold;" target="_blank" title="Click to know more about CREATE">CREATE</a> date to the modify date in the process?<br/> Quote</p><blockquote>Is there a way to recopy the files while modifying the create date to the modify date in the process?<br/></blockquote> <br/>No. You'll have to wait until the pictures reach their final destination before modifying any dates. How is this MicroSD card connected to the computer? If you look in My Computer does it have a drive letter assigned? Do you use the NT copy command to transfer the pictures or some sort of software that came with the phone?<br/><br/>The links I posted may have been unclear. <strong>FileTouch</strong> can be run from the command line and with a little imagination you can extract the modified date of a file and push it into the date created field:<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/set-11758" style="font-weight:bold;" target="_blank" title="Click to know more about SET">SET</a> picDir=c:\temp<br/>for /f "tokens=* delims=" %%i in ('dir %picDir% /b') do (<br/> set dtmMod=%%~ti<br/> "e:\Small Applications\FileTouch\FileTouch" "%picDir%\%%i" "!dtmMod!" -c<br/> echo.<br/>) <br/><br/><strong>picDir</strong> = the location of the pictures. This is why I asked if the SD card (or phone) is assigned a drive letter<br/><strong>c:\filetouch\filetouch</strong> = the fully qualified path to the filetouch program; change as required<br/><br/>Good luck. <br/><br/><br/>Thanks, I will give it a try. The sd card is set up with a drive letter on the lan as I am now using the card slot in my printer. I was <a href="https://interviewquestions.tuteehub.com/tag/simply-248966" style="font-weight:bold;" target="_blank" title="Click to know more about SIMPLY">SIMPLY</a> using drag and drop to do the transfer.</body></html> | |