WinAutomation - windows automation software with macro recorder

      How To - Modify the "Date Created" and "Date Modified" attributes of files

      A couple of weeks ago, we have received the following support request from a WinAutomation user:

      "How can I change a file's modified date? I figured out how to get the modified date but can't figure out how to change it. Essentially I have a TIF and JPG file and I want to make the JPG have the same modified date as the TIF file."

      I did some research over this issue and realized that there is no way to change a file's creation and last modified dates through graphical user interface. I was surprised to see that there are dedicated programs to do exactly that: change the "Date Created" and "Date Modified" attributes of a file.

      With WinAutomation you can easily set a file's "Date Modified" and "Date Created" attribute by simply assigning a value to the LastModified or CreationTime attributes of the variable containing the file. As an example, please examine the screenshot below:

      This job will grab the first jpg and first tif file in the folder "C:\My Files", and change the jpg's Last Modified date to match the tif's Last Modified date. It is just that simple!

      Your rating: None Average: 5 (1 vote)

      Comments:
      #1 by Thomas Minitsios - Fri, 02/05/2010 - 20:59

      The jpg file is not opened or saved at any part of the process (this is why the jpg degradation is not even an issue). The only thing that the specific job does, is changing the attributes "Date Created" and "Date Modified" of the jpg file. You can set any date that you may want as created and modified dates (a past one or a future one).



      #2 by Kandy (not verified) - Mon, 02/01/2010 - 20:19

      Why couldn't you just put another macros into the end of your current one to not save but change the name of the jpeg,save and the change it back,save again. Would this then show the file as modified on the current date? or would you have to actualy save the jpeg with the new name to implement systems current date process?Then wouldn't jpeg degredation become an issue after multiple saves?



      Post new comment

      The content of this field is kept private and will not be shown publicly.
      • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
      • Lines and paragraphs break automatically.
      • Web page addresses and e-mail addresses turn into links automatically.
      • You may quote other posts using [quote] tags.

      CAPTCHA
      This question is for testing whether you are a human visitor and to prevent automated spam submissions.
      Image CAPTCHA
      Enter the characters shown in the image.



      Featured Clients