0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

共有フォルダ内のファイル一覧を保存

Last updated at Posted at 2025-12-05

dirコマンドの場合

共有フォルダのファイルを含む一覧を出力

dir /s /b \\192.168.0.1\share > dir.txt

treeコマンドの場合

共有フォルダのファイルを含む一覧を出力

tree /f \\192.168.0.1\share > tree.txt

共有フォルダのフォルダだけを出力

tree \\192.168.0.1\share > tree.txt

txtの内容をSQLiteに入れるには

# 1. モードを CSV に設定
sqlite3 files.db ".mode csv" 

# 2. dir.txt の内容を Files テーブルにインポート
# (dir.txtにはカンマがないため、各行がそのまま最初のカラムに入ります)
sqlite3 files.db ".import dir.txt Files"
sqlite3 files.db "PRAGMA table_info(Files);"

0|C:\Users\ユーザー名\dir.txt|TEXT|0||0

カラム名をPathに変更しておく。

sqlite3 files.db "ALTER TABLE Files RENAME COLUMN 'C:\Users\ユーザー名\dir.txt' TO Path;"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?