DIR list to text list folders but not what is in them.


  1. Posts : 194
    Win 7,8.1 ,10
       #1

    DIR list to text list folders but not what is in them.


    Is there a way with DIR command line via CMD or power shell to list the contents of a directory but exclude the contents of the folders and generate a a bare list(location name only). Just list the files and folders?
      My Computer


  2. Posts : 14,020
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #2

    In a Command Prompt window type dir /? [note the space] to get a list of switches you can use. I frequently use dir /o/s>dir.txt to get an Organized list of files and subFolders redirected to a dir.txt file in that Folder. Leave off the >dir.txt is only wanting a list on the screen but could use /p to pause it a screenful at a time.
      My Computers


  3. Posts : 2,068
    Windows 10 Pro
       #3

    Give this a shot, and obviously set your starting path to whichever directory you want.

    Get-ChildItem -Path C:\Windows\apppatch |Select-Object FullName
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:10.
Find Us




Windows 10 Forums