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 .

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

Find files using batch script

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

$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

Notes:

  • This script lists files within system32 and its subfolders.
  • The latest version of the Hexnode MDM app should be installed on the device.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.