| 1 | # frozen_string_literal: false |
| 2 | # |
| 3 | # You need WSH(Windows Scripting Host) to run this script. |
| 4 | # |
| 5 | |
| 6 | require "win32ole" |
| 7 | |
| 8 | def listup(items) |
| 9 | # items.each do |i| |
| 10 | for i in items |
| 11 | puts i.name |
| 12 | end |
| 13 | end |
| 14 | |
| 15 | fs = WIN32OLE.new("Scripting.FileSystemObject") |
| 16 | |
| 17 | folder = fs.GetFolder(".") |
| 18 | |
| 19 | puts "--- folder of #{folder.path} ---" |
| 20 | listup(folder.SubFolders) |
| 21 | |
| 22 | puts "--- files of #{folder.path} ---" |
| 23 | listup(folder.Files) |
| 24 |