List of Files

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Mick Powell Mick Powell 6 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36472
    Profile photo of Mick Powell
    Mick Powell
    Participant

    I'm trying to develop a powershell script so that I can run it and get an output of all files with a specific extension on a system. Everything I've tried only works if I give it a specific directory to search in, but I want a list of every single one on the computer. Is there a specific command set I should be looking at?

    #36475
    Profile photo of random commandline
    random commandline
    Participant
    # Replace 'txt' with your extension
    Get-ChildItem -Path \path\to\search -Filter *.txt -Recurse
    
    #36480
    Profile photo of Mick Powell
    Mick Powell
    Participant

    So yeah. That's essentially what I had, and It seemed to me like it wasn't working unless I gave it a specific path. After playing with it more, I realize it's because the file i'm trying to find is in an appdata folder which is hidden. So I added the -hidden switch but then I just get access errors saying "Access to the path C:\this\path\here" is denied.

    An interesting thing is that i've noticed if I set the path to a specific appdata folder, it will pick up the .OST file (the filetype i'm trying to locate on some systems) when i'm NOT using the -Hidden switch, but as soon as I add that switch in, i get those access errors and no output. is there still something i'm missing on this command?

    Thanks for your help.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.