Jump to content

Hielper

Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Hielper's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. ah im started to understand it thx for the correction! you will see a better version soon
  2. 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
  3. solved it already
  4. haha thank you very much for your example Could i ask what the point is of using the three consolewrite lines?
  5. It seems that the problem is in this line, i think about the last parameters Since i was not able to get the dates of the files i want to copy $tijd = StringRegExpReplace(FileGetTime($map & $test[$i], 1, 1), "(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})", "${1}/${2}/${3} ${4}:${5}:${6}") Could you give me an hint for solving it?
  6. #include <File.au3> #include <Date.au3> $map=("C:\school") $test = _FileListToArrayRec($map, "", "", $FLTAR_RECUR, $FLTAR_fullpath) $lala = 7 $map2= ("C:\test") if IsArray($test) Then For $i = 1 To UBound($test) - 1 $tijd = StringRegExpReplace(FileGetTime($map & $test[$i], 1, 1), "(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})", "${1}/${2}/${3} ${4}:${5}:${6}") If _DateDiff('d', $tijd, _NowCalc()) > $lala Then FileCopy($test, $map2) EndIf Next EndIf I try to run the line in this script, but nothing happens
  7. Could you tell me what is wrong here $test = _FileListToArrayRec($map, "", "", $FLTAR_RECUR, $FLTAR_fullpath) $test = _FileListToArrayRec($map, "", "", $FLTAR_RECUR, $FLTAR_fullpath)
  8. I have currently made an array and a forloop that checks a folder path. But what if the folder path has subfolders contained and in the subfolders more subfolders, is there an possibility that i check if it exists and add them to my _Filelist array? Thanks
  9. nvm this can be closed
  10. thanks for the help! i finally understand
  11. yes is there a way to avoid these message boxes, and when the os is compatible just move on to the next comparison i have in mind? and if its not compatible i want to display a box that says not compatible ( already know how to do that)
  12. im using windows 7,
  13. Global $windows [13] ;- $windows[0] = "WIN_10" $windows[1] = "WIN_81" $windows[2] = "WIN_8" $windows[3] = "WIN_7" $windows[4] = "WIN_VISTA" $windows[5] = "WIN_XP" $windows[6] = "WIN XPe" $windows[7] = "WIN_2016" $windows[8] = "WIN_2012R2" $windows[9] = "WIN_2012" $windows[10] = "WIN_2008R2" $windows[11] = "WIN_2008" $windows[12] = "WIN_2003" ;- For $i = 0 to UBound($windows) - 1 If ($windows[$i] == @OSVersion) Then Exit Else msgbox(0, "", "windows niet gesupport") EndIf Next Thank you for the help, Currently i have used your loop and when i come to the else statement, i will get 3 times the window "windows niet gesupport" until it reaches [4] Do you have a solution for that?
  14. Global $windows [13] ;- $windows[0] = "WIN_10" $windows[1] = "WIN_81" $windows[2] = "WIN_8" $windows[3] = "WIN_7" $windows[4] = "WIN_VISTA" $windows[5] = "WIN_XP" $windows[6] = "WIN XPe" $windows[7] = "WIN_2016" $windows[8] = "WIN_2012R2" $windows[9] = "WIN_2012" $windows[10] = "WIN_2008R2" $windows[11] = "WIN_2008" $windows[12] = "WIN_2003" ;- If @OSVersion == $windows[13] Then msgbox (0, "correct", "correct") EndIf Im currently automating an installer, the installer has multiple supported plaftforms so i want to create an loop checking if the current PC is equal to the supported platform(array) Could someone point me in the right direction for creating a loop to check if the current pc is equal to the array. As im not able to do it on my own, tried to google but i dont seem to understand
×
×
  • Create New...