Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Let's say I already have a folder created on the next path file: "C:userscharqusdesktopMyFolder", and I run the next command on CMD:

mkdir "C:userscharqusdesktopMyFolder"

I get a message like this: "A subdirectory or file C:userscharqusdesktopMyFolder already exists".

Therefore, is there any command in the commandline to get rid of this returned messages? I tried echo off but this is not what I looking for.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Redirect the output to nul

mkdir "C:userscharqusdesktopMyFolder" > nul

Depending on the command, you may also need to redirect errors too:

mkdir "C:userscharqusdesktopMyFolder" > nul 2> nul

Microsoft describes the options here, which is useful reading.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...