Well actually, instead of using if checkbox.checked commands which will just take up space.. The most effective command that will take care of everything for you is the following:
Code:
On Error Resume Next
For Each chkbx As Control In Controls
If TypeOf chkbx Is CheckBox Then
If DirectCast(chkbx, CheckBox).Checked Then
Kill(Combat Arms Directory & "\" & chkbx.Text)
End If
End If
Next
This one code will take care of every checked checkbox for you, thus minimizing the work and making your coding more efficient. Now this is assuming your checkbox.text is *.txt, *.jpg, etc..
______
Now the code above won't work with the AhnRpt, CAV, EndingBanner.exe, etc..
A simple DeleteFile command doesn't have the power to delete these files seeing as how they have Read-Only attributes. So you can use the following code:
Code:
If CheckBox(Your Number).Checked Then
If My.Computer.FileSystem.FileExists(Combat Arms directory & ("\CAV.exe")) Then
System.IO.File.SetAttributes(Combat Arms directory & ("\CAV.exe"), IO.FileAttributes.Normal)
My.Computer.FileSystem.DeleteFile(Combat Arms directory & ("\CAV.exe"))
End If
End If
That code will be used for each file you want deleted, just replace the file name with the expected file you want to delete.