China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 07:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to compile a command to return to the carriage with debug? View 3,119 Replies 16
Original Poster Posted 2006-12-15 12:57 ·  中国 广西 南宁 西乡塘区 电信
新手上路
Credits 16
Posts 6
Joined 2006-12-15 12:15
19-year member
UID 73618
Gender Male
Status Offline
May I ask all the experts how it is achieved
Floor 2 Posted 2006-12-15 22:28 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Why do we need to compile a command for carriage return? I don't understand what the brother means?
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 3 Posted 2006-12-16 00:18 ·  中国 广西 南宁 西乡塘区 电信
新手上路
Credits 16
Posts 6
Joined 2006-12-15 12:15
19-year member
UID 73618
Gender Male
Status Offline
I want to put the result of the previous command into the second command, and the result of one command is a carriage return. I don't know how to implement this carriage return.
Floor 4 Posted 2006-12-16 00:35 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  You can easily solve it using the pipe symbol.

  For example: echo cn-dos|find "cn"
Floor 5 Posted 2006-12-16 00:36 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
You can use the pipe "|" operation to "give" the result of the previous command to the second command for "receiving" ~:)

Specific operations also depend on what the previous command is? (Is it the output of a batch process or the output after a command is executed).
Also depends on what the next command is (is it something like FTP that can receive commands from a text file, or can receive parameters, etc....)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 6 Posted 2006-12-16 00:52 ·  中国 广西 南宁 西乡塘区 电信
新手上路
Credits 16
Posts 6
Joined 2006-12-15 12:15
19-year member
UID 73618
Gender Male
Status Offline
The result of the previous command is a carriage return. How is this carriage return implemented? The next command needs to have a carriage return in the middle to be implemented.
Floor 7 Posted 2006-12-16 01:25 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
The command that needs to be followed by a carriage return after echo.|
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 8 Posted 2006-12-16 02:16 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Using prompts is also okay

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 9 Posted 2006-12-16 05:19 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
Try the runas command. This command must enter the password. I tried using | but it didn't work.
bat c c++
Floor 10 Posted 2006-12-16 06:36 ·  中国 广西 南宁 西乡塘区 电信
新手上路
Credits 16
Posts 6
Joined 2006-12-15 12:15
19-year member
UID 73618
Gender Male
Status Offline
The problem is solved. Just use echo.| This is okay. Thank you everyone.
Floor 11 Posted 2007-02-01 22:52 ·  中国 吉林 四平 联通
高级用户
★★★
Credits 859
Posts 413
Joined 2006-08-14 21:55
19-year member
UID 60532
Status Offline
Using the pipe symbol can easily solve it.

For example: echo cn-dos|find "cn" This only displays cn-dos, why does it also produce a carriage return?
Floor 12 Posted 2007-02-01 23:12 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
That carriage return is sent by the Echo command ~:)

If it's like the following, there won't be a carriage return. It waits for you to give a carriage return to indicate the input is complete (confirmation) before it continues to execute ~:)

set /p=cn-dos|find "cn"
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 13 Posted 2007-02-01 23:37 ·  中国 吉林 四平 联通
高级用户
★★★
Credits 859
Posts 413
Joined 2006-08-14 21:55
19-year member
UID 60532
Status Offline
Is this the ASCII code for the carriage return in cn-dos?
Floor 14 Posted 2007-02-01 23:44 ·  中国 吉林 四平 联通
高级用户
★★★
Credits 859
Posts 413
Joined 2006-08-14 21:55
19-year member
UID 60532
Status Offline
echo cn-dos returns also have an empty line?
Floor 15 Posted 2007-02-01 23:46 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Echo cn-dos|find "cn"

Pass the pipe to find to receive...
The string "cn-dos" sent by this Echo is received by find: "63 6E 2D 64 6F 73 0D" (in fact, everything the computer sees is binary, and hexadecimal is used for programming, understanding, and visual convenience), and the last 0D represents the carriage return character, which is sent by Echo to indicate the end of a line :)

Examples of pipeline programming and BASIC demonstrations come from the Microsoft website:
http://support.microsoft.com/kb/46376/zh-cn

[ Last edited by redtek on 2007-2-1 at 10:48 AM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Forum Jump: