LoginSignup
0
1

More than 3 years have passed since last update.

【PowerShell】大量のファイルを一括削除しよう

Last updated at Posted at 2020-08-06
1 / 2

はじめに

仕事中、リモートデスクトップのファイルをたくさんダウンロードしちゃうから、ダウンロードフォルダーにいらないファイルがたまっていってしまう!一個一個消すのはめんどくさいからPowerShellを使って消していきます。

PowerShellスクリプトの中身


cd c:\users\<ユーザー名>\downloads
get-childitem
#上記のコマンドを実行したらchangeDirしたところにあるフォルダーとファイルの一覧が取得できます。
remove-item *.rdp

こんな感じ!

解説

もっと早くできるやり方あるかもしれないけど、消したいファイルがあるところにチェンジディレクトリして、一覧を取得してみて、消す流れ。

消すときは" * " (ワイルドカード)が使えます。

0
1
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
1