How to use the "dir >" command to get a very clean list?

Page 2 of 2 FirstFirst 12

  1. Posts : 14,022
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #11

    When your are at C:\Users\NAMEHERE are you typing just the H: following the \ or are you typing the C:\Users\NAMEHERE>H:? And the quotes are not needed.
      My Computers


  2. Posts : 2,191
    Windows 10 Pro 64-bit v22H2
       #12

    drpeppercan said:
    This "C:\Users\NAMEHERE" does work for me. But "C:\Users\NAMEHERE>H:" Tells me access denied, even though I am running the Command Prompt as an Admin.
    When you type in a command the default is to direct the output to the display. You can override that by using redirect operators. One such operator is >. for example, dir > filename.txt, redirects the output of the dir command to the file filename.txt.

    Your command is trying to redirect to H: . Since H: by itself is protected then your command is illegal. However, you can redirect to a file, such as H:\file.txt.

    DOS is a very fickle in that it requires precise syntax. You can't just make it up. I suggest you learn how to use DOS commands and their syntax. Remember if the syntax is wrong DOS gives an error.

    An A-Z Index of Windows CMD commands.
    An A-Z Index of Windows CMD commands - SS64.com

    A categorized list of Windows CMD commands
    Windows CMD Commands (categorized) - Windows CMD - SS64.com

    How-to: Redirection
    Command Redirection, Pipes - Windows CMD - SS64.com
      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 22:37.
Find Us




Windows 10 Forums