View Files and Folders

SOTI MobiControl
Windows

Efficient file and folder management improves accessibility and organization on devices. With SOTI MobiControl, admins can use scripts to list all files and folders on Windows devices, ensuring easy retrieval and streamlined management.

Important:
  • It is recommended to test the script on a local/ test machine for its purpose and effects. 
  • SOTI MobiControl will not be responsible for any damage/loss to the data/setup based on the behavior of the script.

View files and folders present at the specified path

1 Get-ChildItem -Path<path>

View all files and folders including hidden files

1 Get-ChildItem –Path<path> -Force

View all the files and folders up to the specified level

1 Get-ChildItem –Path< path> -Recurse -Depth<Specify number>

List all the empty files

1 Get-ChildItem -Path <path> -Recurse -File | foreach{
2 if((Get-Content $_.FullName) -eq $null){
3 $_.FullName
4 }}

List all the empty files using length parameter

1 Get-ChildItem –Path <path> -Recurse | where{$_.Length -eq 0} |
2 Select @{N='EmptyFiles';E={$_.FullName}}

Was this helpful?

Need more help?
Ask Community