Currently im trying to make the script work with parameters, eg i want to add an parameter that the user can type a variable in cmd, so that the script automatically deletes files older than XX days
Im not asking for an solution, i just need a push in the right way so i can figure out it myself
since i didnt understand much of the helpfile
This is currently my script
#include <File.au3>
#include <Date.au3>
#include <FileConstants.au3>
Global $map =("C:\school\")
Global $test = _FileListToArrayRec($map, "*" ,$FLTAR_Files,$FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)
Global $test1= $Cmdline[2] ;filerecycle of file delete
Global $quantity = $Cmdline[1]
$Cmdline[0] >
$Cmdline[1] = $quantity
$Cmdline[2] = $test1
if IsArray($test) Then
For $i = 1 To $test[0]
consolewrite("locatie: " & $test[$i] & @CRLF)
$tijd = FileGettime($test [$i], 1,1)
$tijd = StringRegExpReplace($tijd,"(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})", "$1/$2/$3 $4:$5:$6")
If _DateDiff('D', $tijd, _NowCalc()) > $quantity & $cmdline[2] <> "d" Then
msgbox( 0,"", "je hebt d ingevoerd")
ElseIf _DateDiff ('D', $tijd, _NowCalc()) > $quantity & $cmdline[2] <> "r" Then
msgbox(0, "", "je hebt r ingevoerd")
EndIf
Next
EndIf