Jump to content

Recommended Posts

Posted (edited)
20 hours ago, Subz said:

With regards to FileSelectFolder you could have just used:
nb: Please see the help file for more information.

Global $g_sSelectFolder = FileSelectFolder("Select Folder", "F:\++")
    If @error Then Exit MsgBox(4096, "Error", "No folder selected")
Global $g_aPNGList = _FileListToArrayRec($g_sSelectFolder, "*.png", 1, 1, 0, 2)
...

 

Thank you for this bit of information.
I remember i tried someone else's code with a code that could let me choose a folder ... but i don't remember the topic or the code, but what do i know, is that it didn't looked anything similar to this, so ... yeah ... if i knew, i could have just used this code, but i didn't knew so i didn't used it :)

 

L.E.: The code is:

$sFolder = FileSelectFolder("Select a folder to scan", "")
$sFolder &= ""
$aFiles = _FileListToArray($sFolder, "*.exe")

And the original post was this: 

Of course, in order to work, i had to make it like this:

 

#include <File.au3>

$sFolder = FileSelectFolder("Select a folder to scan", "")
$sFolder &= ""
$aFiles = _FileListToArray($sFolder, "*.png")
Global $g_aPNGList = _FileListToArrayRec($sFolder, "*.png", 1, 1, 0, 2)
If @error Then Exit MsgBox(4096, "Error", "Unable to create file list.")
Global $g_sPNGCreated
For $i = 1 To $g_aPNGList[0]
    $g_sPNGCreated = FileGetTime($g_aPNGList[$i], 1, 0)
    ConsoleWrite($g_aPNGList[$i] & " = Created DD/MM/YYYY HH:MM:SS : " & $g_sPNGCreated[2] & "/" & $g_sPNGCreated[1] & "/" & $g_sPNGCreated[0] & " " & $g_sPNGCreated[3] & ":" & $g_sPNGCreated[4] & ":" & $g_sPNGCreated[5] & @CRLF)
Next

So i had to change from this: $g_sSelectFolder [from here: Global $g_aPNGList = _FileListToArrayRec($g_sSelectFolder, "*.png", 1, 1, 0, 2)]

to this: $sFolder [from here: Global $g_aPNGList = _FileListToArrayRec($sFolder, "*.png", 1, 1, 0, 2)]

Of course that $g_sSelectFolder and $sFolder are interchangeable and do the EXACT SAME THING!!!!

So, yeah ... anyone reading the Help Files will find this info, in the very first 5 seconds :) :))

(It's just an observation, not to be taken like a rant)

Edited by BogdanNicolescu
Posted

Now that we covered the topic 

How to Get Created Date from File Properties with Autoit

Now i would like to know how to get from just one file, i don't need a file list, for that i have Power Shell.

 

I want to take the Crated Date from a file that is inside a folder with similar files, copy the crated date and paste it ..... in some other text editor (notepad, paint, excel, word etc.)

It's okey to ask here? Or should i make a new topic? With a name .... let's say ...

How to Get Created Date from File Properties with Autoit from a file inside a folder with similar files to be edited

:):thumbsup:

Thank you!

 

Posted
Quote

So i had to change from this: $g_sSelectFolder [from here: Global $g_aPNGList = _FileListToArrayRec($g_sSelectFolder, "*.png", 1, 1, 0, 2)]

No you didn't, the ellipsis (...) at the bottom of the code from my last post meant add the rest of the script that I had written below?

Quote

Of course that $g_sSelectFolder and $sFolder are interchangeable and do the EXACT SAME THING!!!!

Well considering I was referring to the code I wrote previously, why would I reference another persons variables?

After all that you added two lines that do nothing

$sFolder &= ""
$aFiles = _FileListToArray($sFolder, "*.png")

With regards to your last post, if you look at the two examples I've already given on how to use FileGetTime, you should be able to work out how get the created time stamp from a single file, look at FileOpenDialog, FileGetTime, ClipPut (add the time stamp to clipboard) or FileWrite (to write the date to a file).

 

 

Posted
15 minutes ago, Subz said:

No you didn't, the ellipsis (...) at the bottom of the code from my last post meant add the rest of the script that I had written below?

Well considering I was referring to the code I wrote previously, why would I reference another persons variables?

After all that you added two lines that do nothing

$sFolder &= ""
$aFiles = _FileListToArray($sFolder, "*.png")

With regards to your last post, if you look at the two examples I've already given on how to use FileGetTime, you should be able to work out how get the created time stamp from a single file, look at FileOpenDialog, FileGetTime, ClipPut (add the time stamp to clipboard) or FileWrite (to write the date to a file).

 

 

You took out from the context some vital info.

 

Yes, of course, i have used your full code, and with the code for selecting the folder.

 

My point was, that if i knew a code for selecting the folder, i would have used it, but as i didn't knew any code, i didn't.

Well ... i had a hunch of a "selecting folder" code, but i couldn't put my finger on it, and that was in the code in that post found by me.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...