Sign in to follow this  
Followers 0
uznut

Filegettime Problem

2 posts in this topic

#1 ·  Posted (edited)

Um im having a problem get it to show the date of creation on files other than an exe file. i need it to display it on like text files and other stuff

$t = FileGetTime("C:\Windows\directx.txt", 1)

If Not @error Then

$yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]

MsgBox(0, "Creation date of whatever", $yyyymd)

EndIf

Edited by uznut

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

any file should work, but remember not all systems are in the same folders, so you might want to use the @ macros.

test this code, it works fine on every file in my system.

$t = FileGetTime("C:\config.sys", 1)

If Not @error Then
$yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]
MsgBox(0, "Creation date of whatever", $yyyymd)
EndIf

and not everyone has directx.txt.

$t = FileGetTime(@WindowsDir& "\directx.txt", 1)

If Not @error Then
$yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]
MsgBox(0, "Creation date of "&@WindowsDir& "\directx.txt", $yyyymd)
else
MsgBox(0, "I can't find "&@WindowsDir& "\directx.txt", "bad directory?")
EndIf
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0