File Path, Name, Date, Time and Size

This task will loop through a folder of files and display each file’s path, name, date, time and size. In order for this task to work properly, please create a folder named “temp” in your c:\ drive and copy some files into it or modify the specified folder in the ‘Loop Files’ action. A variable is first created (theFileName) using the ‘Create Variable’ action which will hold the value of a file’s name when it is passed and used in a ‘Loop Files’ action. The ‘Loop Files’ action loops through the files contained in the folder chosen. The previously created variable (theFileName) is specified in the “Populate variable with filename” field and is updated with the current filename. With each successive loop, the next filename is retrieved. The loop ends after all the filenames have been retrieved or when a Break is encountered. Within the loop a ‘Message Box’ action displays a dialog which shows the path, name, size, date and time of the current file it has retrieved using the functions FileDateTime() and FileLen(). FileDateTime() is being used to get the files date and time. The FileDateTime() function can tell when a specific file was first created or last modified. FileDateTime returns both the date and time information as a string variable. The FileLen() function returns the length of a file in bytes. If the specified file is open when FileLen() is called, the value returned represents the size of the file immediately before it was opened. Note: Both of these functions can be found in the AutoMate 6 ‘Expression Builder’ which is accessible within any available action. Help on these functions (as well as many other functions) can be found in the AutoMate Help File at AutoMate -> Reference -> Basic Scripting -> Functions.