|
|
|||||||
Hello. I am using dirlist to get an array to check all dirs in a given location. In all dirs returned, I need to extract creation month, date etc. The script is something like this: Code: Call "udf\dirlist.udf" $Files = Dirscan('\\fmtefil1\tsprofiler', 1) ; return a list of all files with complete paths For Each $file In $Files 'Filnavn: $file' ? $check = GetFileTime('$file',"1") $Createyear = SubStr("$check",1,4) $CreateMonth = SubStr("$check",6,2) $CreateDate = SubStr("$check",9,2) 'Month: $CreateMonth' ? 'Date : $CreateDate' ? ;then some checking will be done --- --- Next All dirs return as I want, but I am not able to extract the $CreateYear, month and date, which is essential to process the dirs further. I am doing something wrong, but can't seem to find out what it is. Anyone?? Regards /J |
||||||||
|
|
|||||||
In your script you get the folder name but not the full path. The DirScan UDF will return the full path if you sue 0 as the second parameter. You have it set to 1, this will return the folder name but not the path so GetFileTime will fail because it cannot find the folder. A few comment:
The script below works great for me (with a different folder to scan ). Code: Break on $Files = Dirscan("\\fmtefil1\tsprofiler", 1) ; return a list of all files with complete paths For Each $file in $Files "Filnavn: " + $file ? $check = GetFileTime($file,"1") $Createyear = SubStr($check,1,4) $CreateMonth = SubStr($check,6,2) $CreateDate = SubStr($check,9,2) "Month: " + $CreateMonth ? "Date : " + $CreateDate ? ;then some checking will be done Next Sleep 5 |
||||||||
|
|
|||||||
I was sure that I posted a post just minutes after, because I saw what I had been doing wrong (allthough the script surely can be improved), but I must have forgotten to post it. But tnx anyway Mart, appreciating you are correcting me, have been unsure of when to use the " and when to use the ' And.. I was using Dirscan, because I only need to check the Dirs in the directory of choosing. Tnx Regards /J |