Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local image_types = { ".mp4", ".png", ".jpg", "jpeg", ".gif", "webm" }
- os.execute("dir /w /b > files.txt") -- Windows-specific
- os.execute("mkdir non-image")
- local file = io.open("files.txt")
- for line in file:lines() do
- local keep = false
- for _, t in ipairs(image_types) do
- if line:sub(-4) == t then
- keep = true
- break
- end
- end
- if not keep then
- os.execute("move \""..line.."\" non-image/")
- end
- end
- os.remove("files.txt")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement