how can I delete all the files bat?
don't work
Code: Select all
delete file mypath&"/*.bat"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
delete file mypath&"/*.bat"
Code: Select all
...
## 1. navigate to target folder
set the folder to mypath
## 2. get all the files in htis folder
put the files into tFiles
## 3. FILTER out only *.bat files
filter tFiles with "*.bat"
## 4. now loop through the files and delete them
repeat with i = 1 to the num of lines of tFiles
delete file (line i of tFiles)
end repeat
...
Code: Select all
set the defaultFolder to "PATH_TO_FILES"
put the files into tFiles
repeat for each line tFileName in tFiles
if (character -4 to -1 of tFileName = ".bat") then
delete file tFileName
end if
end repeat