I'm looking for a code to search whole computer (might be several disks) for a specific file extension, in my case .pst and for the batch to output the location or for it to show 'No .pst found'. I'm just starting to write scripts in cmd.
For example I'm using 'dir /s *.pst' or 'where /r C:\ *.pst' into 'where /r D:\ *.pst' it shows the file's location, but I'm not sure how to use the else part of statement.
If I use 'dir /s *.pst' through monitoring and management system, it either gets the file's location IF it's there, or shows 'invalid parameters' if it doesn't.
I'd need something along the lines: If file exists anywhere on PC in any disk = Yes - %file location%
Else = No
Thank you.
Aucun commentaire:
Enregistrer un commentaire