Given that no one has given a satisfactory answer to this thread I now launch the question anew: how could I set a time stamp to a directory (not to a plain file)? The code linked to in that thread works well under Win2k, but not in 98 or XP.
Printable View
Given that no one has given a satisfactory answer to this thread I now launch the question anew: how could I set a time stamp to a directory (not to a plain file)? The code linked to in that thread works well under Win2k, but not in 98 or XP.
bump
bump again
The app in "ChangeFold1816461192004.zip" actually does work, but has at least 2 errors in the code. (I'm using XP Pro)
In form_load:-
LastDirIndex = GetSetting(App.EXEName, "Settings", "LastDirIndex", -1 )
in cmdApplyFolder:-
GoTo Exit_cmdApplyFolder_Click
EXIT SUB
oops:
'Abort=3,Retry=4,Ignore=5
Using SetFileTime to change a directory's time/date stamp will always return an error as it wasn't designed for this, even though it (mostly) works. Also see:-
http://vbnet.mvps.org/index.html?cod...erdatetime.htm
for their method of "casting" the return value.
(and you may have to work on the interface :wave: )
I've made the changes you point out and it seems to work in some cases, I still have to study the code carefully. I actually set it aside when I saw it gave me those errors.Quote:
Originally Posted by schoolbusdriver
Thanks for now.
For some reason, the hour stamp always seems to out by 1 hour. Possibly because "wDayOfWeek" has been commented out (haven't checked, maybe it's just me...). This could end up as a quite useful tool by adding a calendar control - mscal.ocx, or better still the monthview control in comct232.ocx (and removing the code errors, and modifying the interface, and proper error handlers, and.... Maybe it should just be rebuilt) :rolleyes:
I've got good reasons to timestamp files (I've already written an app to do this). It's never occurred to me to do the same with directorys'. It seems worthy of a full exe. Oh well, here I go, tomorrow...
Yes, I recently finished writing my own file time-stamping utility as well. The main purpose was to sort by time some mp3 files. If it's not just a song but, say, a Beethoven symphony, if the 2nd movement was completely downloaded before the 1st, then when I played it in a mp3 device, this 2nd movement was played first.Quote:
Originally Posted by schoolbusdriver
The directory thing is not actually necessary but I thought I might need it some time in the future.
If I've done this right, there should be a zip file attached with a reincarnation of my date/time changer. It needs mscomct2.ocx, and will only change folder dates/times on win2k or later (or so the MS docs say). The code's too big to post, and there's no help file of course :) If you have any probs...
Nice code, indeed :thumb:Quote:
Originally Posted by schoolbusdriver
Project is broken. Has spaces instead of :'s in between numbers in times, so gives error when trying to convert to system time. Easily fixed, just thought I'd mention it 4 the next one to download it and have to trouble shoot for a while.
BTW,i though it was called the idiot tax?Quote:
Lottery is a tax on people who are bad at maths.
Yes, but you can't be so rude to people.Quote:
Originally Posted by ididntdoit
Strange - works OK on my PC. Can't check it on anything other than XP Pro. Can you post the bit that gives the error - and a correction of course ;)Quote:
Originally Posted by ididntdoit