Using two commands simultaneously in DOS

  • Thread starter Thread starter jackson6612
  • Start date Start date
  • Tags Tags
    Dos
Click For Summary
Using multiple DOS commands in a single line is possible, but specific syntax is required. To display only the top-level directories without sub-folders using the TREE command, there isn't a direct command to hide sub-folders. However, users can utilize the DIR command instead, which allows for more control over the output. For instance, the command "DIR C:\" will list only the top-level directories.Regarding the TREE command combined with the MORE command, if a user wants to abort the command while it's running, they can typically use Ctrl-C to stop the output. This allows them to regain control without waiting for the entire list to finish displaying.
jackson6612
Messages
334
Reaction score
1
Hi

1: Is this possible to use two or more DOS commands in the same line. When I enter the command "TREE C:\" it displays all the folders (=directories) and sub-folders present there in the drive C. But I don't want to see the sub-folders displayed in the tree. I don't know the command for hiding the sub-folders. I hope there is one. That would mean I need two commands in the same line, i.e., [Command to hide the sub-folders] [TREE] [C:\].

Could you please help me with it?

2: Suppose I enter the command "TREE C:\ |MORE". I would get a limited list of the folders and sub-folders and then I would have to press/tap ENTER key to see the remaining list. Suppose, in the midway I want to abort that TREE command, how could I do it? Do I have to the list to its very end to enter a new command? Please have a look on the video:
 
Last edited by a moderator:
Technology news on Phys.org
Why TREE and not just DIR? Try if Ctrl-C doesn't stop the listing.

I have not used DOS prompt in ages, so I can be wrong.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
9
Views
4K
  • · Replies 12 ·
Replies
12
Views
11K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 19 ·
Replies
19
Views
5K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 19 ·
Replies
19
Views
931
  • · Replies 3 ·
Replies
3
Views
1K