Modify file date and time
Moderators: JRL, Dorian (MJT support)
Modify file date and time
I had 29,000 CNC files that needed modification. I wrote a script that read each one line by line, made the appropriate changes and rewrote the files to a temporary location. My problem now is that the file dates on the original files go back 7 years and I need to modify the dates on the new files to match the dates on the old files.
I am aware of a third party program called "touch.exe" that can perform this operation but I'd rather not use a program that is not a part of the operating system or a part of Macro Scheduler. Ideally there is way to do this using a library function or a VB Script. I've been searching all morning and I've come up empty. Does anyone know of a way to modify a file's date and time using Macro Scheduler?
Thank you,
Dick
I am aware of a third party program called "touch.exe" that can perform this operation but I'd rather not use a program that is not a part of the operating system or a part of Macro Scheduler. Ideally there is way to do this using a library function or a VB Script. I've been searching all morning and I've come up empty. Does anyone know of a way to modify a file's date and time using Macro Scheduler?
Thank you,
Dick
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Should they all have the same date, or different dates?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Do you still have the original unmodified files? I'm thinking of a workaround where your script would read the filedate/time of the original file, set the system date/time to the same date/time, then modify the file ... then move on to the next and repeat ...
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
yes, still have the old files.
I had thought about the same and that's what I intended to do if there was no magic way to get this done. If that is the best way then don't spend any more time on it. Just let me know its the only way and I'll manage.set the system date/time to the same date/time, then modify the file
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It might not be the only way, but I'm 99.9% certain there is no way to modify the file date with VBScript, and I'm not sure of any other way. It can probably be done with Win32 API but without further research I'm not sure of the details or whether it is something that MacroScript can handle.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?