Category filter
Script to find a File on Windows devices
Searching for specific files on a device can be tedious and time consuming for users. If searching for and finding files are made easy, managing data becomes easier. Hexnode lets admins find files on devices with specific extensions using scripts .
Find files using batch script
1 |
dir /S *.txt |
This command lists all files with .txt extension (text files). You can list files with other extensions by replacing ‘.txt’
dir
: Command is used to list files in command prompt
/s
: Lists files in current folder and ones in subfolders
*
: dir commands allow wildcards. Displays information that matches the pattern specified
Find files using PowerShell script
1 2 3 4 |
$Dir = get-childitem C:\windows\system32 -recurse # $Dir |get-member $List = $Dir | where {$_.extension -eq ".txt"} $List | format-table name |
$Dir = get-childitem C:\windows\system32 -recurse
: path of files is recursively searched in subfolders
List = $Dir | where {$_.extension -eq ".txt"}
: files with .txt extension is listed