Hi Appologies if this has been answered before, I've have searched the forum but cant seem to find what I need.
I'm am writing a script for decommissioning PC's at work, which requires varies different aspects, I run eraser on some folders to delete sensitive data, remove some directories which will always be present but I have a number of files that may or may not be present, scattered around the machine.
I originally did this a large number of IF statements, which work's but is not the best so a friend suggested doing it in a loop but i'm not having much luck with it, I'm quite new to scripting and dont have any real experience apart from some VERY basic batch files.
I have 12 files which may or may not be present, if 1 of the 12 files isn't present I would like it to carry on to the next file and delete it if it is there and so on through all the files.
I've put a snippet of script below, which when i try and run i get an error "Until" statement with no matching "Do" statement.:
Until $i = 12
Could anybody point me in the right direction for how to achieve this
Local $i = 0 ;set $i as an interger Local $1 = ( $allusersprofile & "\Desktop\xxxxx.lnk" ) ;file 1 to delete Local $2 = ( $public & "\Desktop\xxxxx.lnk" ) ;file 2 to delete local $3 = ( "C:\xxxxxx.flg" ) ;file 3 to delete Do If FileExists ( $i + 1 Then ) FileDelete ( $i + 1 ) $i = $i + 1 Until $i = 12