Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file date stamp

Status
Not open for further replies.

moben

IS-IT--Management
Feb 5, 2002
116
GB
How does one get the date/time stamp for a file (on a Windows networked file server) within a vb6 application ? I need to compare file of the same name being replaced every 15 minutes ?

Any responses very much appreciated.

Regards,

Moben
 
Code:
With New FileSystemObject
    MsgBox .GetFile("X:\...\myFile.txt").DateLastModified
End With
 
Golum,

Thanks for the info can I just insert the code into my VB6 app (say within a procedure), is there any other stuff I have to do, like declarations etc as I get user-defined type not defined error ?


Thanks,

Moben.
 
Not trying to steal Golom's thunder by answering but you will need to add a reference to 'Microsoft Scripting Runtime'

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Golom and HarleyQuin,

Thanks for the info, how do I get the value to be stored into a temporary variable instead of being displayed in a message box ?

Thanks,

Moben.
 
Hi,

You will need to declare your variable.

Then you will need to set it equal to the value you want e.g.
Code:
With New FileSystemObject
    YourVariable = .GetFile("X:\...\myFile.txt").DateLastModified
End With
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks,

I was declaring a variable, but inadvertantly left out the '.' just before the GetFile statement !

Any way many thanks for your kind and quick responses.

Regards,

Moben.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top