CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Aug 26, 2003 4:50 am Post subject: Get or Set File/Folder Date/Time in NT/2k/XP |
|
|
Set File/Folder Date/Time in NT/2k/XP
========================
This is a example showing how to get information and change file and folder date time. Said to be a little more difficult on NT based operating systems this example does that using API.
Please note that this example as such doesn't work on win 9x.
Get the package with examples from here:
http://codescript.vdsworld.com/VDS5src/Set_date_time-XP.zip
If you don't want to deal with directories then use the built in VDS commands:
@FILE(<file description>, T)
and
FILE SETDATE, <file path>, <time>, <date>
However it may not set all the 3 attributes seperately.
Here are the commands and functions available in this DSU :
Get File/Folder Date time Info:
=========================
Code: | %A= @FILEINFO(GET,CREATED,%F)
%A= @FILEINFO(GET,MODIFIED,%F)
%A= @FILEINFO(GET,ACCESSED,%F) |
where %F is the path of the file or directory to obtain info.
Set the File File/Folder Date time Info:
========================================
Code: | FILEINFO SET,CREATED,%F,Date,Month,year,hour,min,sec
FILEINFO SET,MODIFIED,%F,Date,Month,year,hour,min,sec
FILEINFO SET,ACCESSED,%F,Date,Month,year,hour,min,sec |
where %F is the path of the file or directory to be modified.
Win 9x version may be easier but I never tried one for it. Because I am not currently using it. Sorry.
Disclaimer:
===========
The unit uses windows API. Use at your own risk.
Enjoy. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|