Skip to main content
  1. Posts/

Forfiles Command Windows

·1 min·
windows windows
Table of Contents

Forfiles digunakan untuk memilih satu atau lebih file lalu mengeksekusi perintah pada file tersebut. Perintah ini sangat berguna untuk batch job atau menjalankan perintah pada banyak file tanpa mengesekusi satu per satu.

Syntax
#

FORFILES [/P pathname] [/M searchmask] [/S]
         [/C command] [/D [+ | -] {MM/dd/yyyy | dd}]

Examples
#

List nama file pada direktori saat ini yang tidak diubah (last modified) selama 30 hari terakhir.

forfiles /d -30

Hapus file yang tidak diubah selama 30 hari terakhir

forfiles /d -30 /c "cmd /c del @file"

Cari setiap file dengan ekstensi .txt lalu buka dengan notepad

forfiles /m "*.txt" /c "cmd /c notepad @file"

Pindahkan semua file yang terakhir ubah sebelum 15 Maret 2018 dengan ekstensi .zip pada dir C:\Users\myuser\Downloads ke tujuan C:\Users\myuser\backups

forfiles /s /p "C:\Users\myuser\Downloads" /m "*.zip" /d -"03/15/2018" /c "cmd /c move @path C:\Users\myuser\backups"

Related

Using Overlay Network in Docker
·2 mins
docker docker
Building Docker Images with Dockerfiles
·1 min
docker docker
Setup NFS Server With Docker
·2 mins
docker docker
Using Bridge Network in Docker
·3 mins
docker docker
Remote Host Docker menggunakan Docker Context
·2 mins
docker docker
Enable LiteSpeed Cache Engine
·1 min
cpanel litespeed cpanel