Windows 10 Command Prompt Shows Number 1

Asked 2 years ago, Updated 2 years ago, 69 views

I have a question at the Windows 10 command prompt.

dir>tmp.txt

Create a batch file that says and name it test.bat .
This is done at the command prompt.

D:\>test

D:\>dir1>tmp.txt

appears with a half-width "1" in front of the redirect symbol.
Also, the half-width space after the redirect symbol disappears.
The contents of tmp.txt are fine.

Why are instructions different from the contents of the batch file printed?
Does this 1 mean the standard output STDOUT?
The batch file is S-JIS and the command prompt is CP932.

windows batch-file command-line

2022-09-29 22:24

1 Answers

Batch files-How To...Display and Redirect Output reads:

When use > to redirect Standard Output, CMD.EXE interprets this as 1>, as can be seen by writing and running...

I edited this post based on @metropolis's Comment and posted it as Community Wiki.I edited this post based on @metropolis's Comment and posted it as Community Wiki.


2022-09-29 22:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.