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-06-23 04:54
中国DOS联盟论坛 » 意见反馈 & 网友交流 » [Recommendation] Instructions for Using the DOS Command Prompt Interface in the Forum and Detailed Explanation of Commands DigestI StickyI View 121,896 Replies 156
Original Poster Posted 2007-01-17 16:12 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Recently, some users have inquired about the basic usage methods of the DOS command prompt interface in the forum, such as how to reply to posts and send private messages from the command line. Given that the previous introductory content about the DOS command prompt interface was scattered in different posts on the forum, and the help for the command prompt interface itself was originally in English (multilingual support, including Simplified and Traditional Chinese, has been supported since version 3.4), now I will summarize the detailed Chinese usage methods of each command in the DOS command prompt interface and common operation problems into this post (equivalent to a user guide). The address of the DOS command prompt interface in the forum is as follows, and everyone can use it while continuing to read:

http://www.cn-dos.net/forum/cmdprmt.php

==Table of Contents==
1. Brief Introduction
2. Function Overview
3. Common Operations
4. Command Explanation
5. Development Instructions

Part 1: Brief Introduction

The forum's DOS command prompt interface is the web command line version of the China DOS Union forum. It supports various common browsers currently, including Internet Explorer 5.5+, Mozilla Firefox 1.5+, Opera 9+, or browsers fully compatible with them. Now, the forum's DOS command prompt can complete most basic functions that the forum's GUI version can, such as user login/logout, viewing user status or information, browsing posts, editing posts, searching posts, subscribing to topics, sending and receiving private messages, etc. In addition, it has many functions unique to the command line, including freely writing batch files. Its usage method is very similar to the pure DOS and Windows CMD command prompt, integrating the main advantages of these two environments and combining some forum characteristics, especially the characteristics of the China DOS Union forum which focuses on DOS discussion. Through the command line interface, users can complete the functions they want through one command or a series of commands, including simple and complex functions, which are usually more efficient and faster than using the GUI interface. This is also the main reason why many people study and learn the command line and batch processing. At the same time, the forum's DOS command prompt supports the multi-language interface function (including Simplified Chinese, Traditional Chinese, and English). The default starting language is the default language of the user's browser, and the interface display language can be manually specified or switched on the command line at any time (see the CHCP command for details), to give everyone a familiar language environment.

Part 2: Function Overview

The forum's DOS command prompt interface supports most common commands in the DOS/CMD environment, as well as some forum-specific commands, which can be used to directly access and operate the forum. Most commands support some parameters or switches. Users can enter the HELP command at any time on the command line to view the command list and description, and use "HELP command name" or "command name /?" to view more help about the command. The commands supported by the forum's DOS command prompt interface are divided into two categories. One category is commands that do not need to be submitted to the server (similar to internal commands in DOS), and the other category is commands that need to be submitted to the server (similar to external commands in DOS). The former will be executed directly after input, and the latter will be automatically submitted to the server for execution, such as displaying posts, editing posts, sending and receiving private messages, etc. If the latter is executed normally, the returned ERRORLEVEL value is 0; otherwise, the returned ERRORLEVEL value is 1. If the received server response is incorrect, the returned ERRORLEVEL value is 2.

Many concepts and commands used in the forum's DOS command prompt interface are very similar to the corresponding content in DOS/CMD. The files in the DOS command prompt interface are equivalent to topics, posts, and private messages in the forum according to the file system, the directory is equivalent to the forum section, and the drive is equivalent to the forum category and inbox/outbox, etc. The commands inside are also very similar to the functions in DOS/CMD. For example, the DIR command can view files and directories (posts, sections, private messages, etc.); the DEL command can delete files; the REN command can rename files; the TYPE and MORE commands can display the content of files (topics, posts, private messages). Among them, the MORE command will prompt to press a key to continue to display the content of the next post after displaying the content of one post in the topic, which can greatly facilitate the reading of posts especially when there are many posts in the topic; the EDIT command can post new topics, reply to posts, and edit post content. For example, EDIT C:\1 command means to post a new topic in the C:\1 section, EDIT C:\1\2 means to reply to the C:\1\2 topic, and C:\1\2 3 means to edit the 3rd reply in the C:\1\2 topic (where 3 is the post number, 0 means the topic post, 1 means the first reply, and so on, and when it is negative, it starts counting from the last post; and the TYPE, MORE, and FIND commands can also optionally support this usage); the NET SEND command can send/reply to private messages, etc. In addition, for the files subscribed by the user (using the NET FILE command), a faster access to the file can be achieved in the form of ~1. For more detailed information, please refer to the command help and the command explanation below.

Similar to DOS and CMD environments loaded with DOSKEY, the forum's DOS command prompt supports the command line history function. Users can press the cursor keys or PageUp/PageDown keys on the command line at any time to edit or re-call previously entered commands, which greatly facilitates command line operations. The HISTORY command can be used to view the command line history.

The default drive letter after the forum's DOS command prompt interface is started is A (other drive letters respectively represent different sections or special functions. For example, drive C represents the forum's site management area, drive D represents the DOS technology area, drive G represents the inbox, etc., which can be seen with the DIR command). And some environment variables will be automatically set, such as %AUTOSUB%, %CODEPAGE%, %DIRCMD%, %OS%, %PROMPT%, %USERNAME%, which respectively represent whether to automatically subscribe to edited files (default is 1), the current code page (default is 936, which is Simplified Chinese, and can be changed to English with the CHCP 437 command), the pre-set switches of the DIR command (default is /P /V, which can be modified by yourself), the operating system used by the user (such as Windows, POSIX, etc.), the prompt (default is $P$G, which can be modified by yourself), and the user name (if already logged in). In addition, when the user does not manually set these environment variables such as %CD%, %DATE%, %TIME%, %RANDOM%, %ERRORLEVEL%, they respectively represent the current path, current date, current time, a random integer, and the current ERRORLEVEL value, which are consistent with CMD.

Many users like a personalized environment, such as automatically using their favorite colors, fonts, etc. when starting. The forum's DOS command prompt supports storing commands (any command except EDIT) in the A:\AUTOEXEC.BAT file, so that these commands will be automatically run every time it is started. AUTOEXEC.BAT is a self-start batch file, similar to DOS, and will be automatically run every time it is started. The AUTOEXEC.BAT file in the forum's DOS command prompt interface is user-level, and different users can have different AUTOEXEC.BAT files, and users can use it as long as they log in. By appropriately modifying it (using the EDIT command), such as modifying the corresponding environment variables, font, line spacing, color, prompt, window title, etc., users can achieve the purpose of a personalized environment. Not only that, because the content in the AUTOEXEC.BAT file will not disappear, it can also be used to complete functions like favorites. The following is an example of a simple AUTOEXEC.BAT file:

@echo off
break on
rem Set environment variables:
set dircmd=/a/p
set prompt=$t-$p$g
...
goto end

:end
echo The following will modify the font, color, and title. You can press Ctrl+C to cancel.
pause
if %os%#==Windows# font FixedSys
if %os%#==POSIX# font Terminal
font 10%%
color 06
title My DOS Prompt
echo Starting to run..


In addition to the AUTOEXEC.BAT file, users can also freely create and edit other files on drive A, which is equivalent to the user's personal file storage space (different users can create different files). For example, you can use the EDIT A:\HELLO.TXT command to create a HELLO.TXT file on drive A (if it already exists, it will modify the original file). At the same time, you can use other commands to operate these files (the same as the commands in DOS/CMD, such as TYPE/MORE to display the file content, DEL to delete the file, REN to rename the file, etc.). For batch files, users can execute them directly as in DOS/CMD, and can use replaceable parameters such as %0, %1, %2.

Part 3: Common Operations

To facilitate everyone's quick start and use, the following lists the usage methods of some common operations:

1: Switch interface language
The CHCP command can be used to switch the current language code page. For example, CHCP 437 switches the language code page to 437 (English), CHCP 936 switches the language code page to 936 (Simplified Chinese), and CHCP 950 switches the language code page to 950 (Traditional Chinese).

2: Customize the interface
A series of commands such as FONT, COLOR, TITLE, PROMPT can be used to define the interface of the command prompt, such as changing the font, line spacing, color, window title, prompt, etc. Please refer to the usage instructions of these commands for details.

3: View help
All commands have relevant usage help. You can add the /? switch after the command name or use the form HELP to view. If you directly enter the HELP command, it will list all commands. The language of the help information displayed is the language of the current code page.

4: Log in/log out of the forum:
Log in to the forum with the specified user name:
NET LOGON username password (or NET LOGIN username password)
Log out of the current user:
NET LOGOFF (or NET LOGOUT)

5: List forum sections:
You can directly enter the DIR command under drive A to view all sections in the forum. If logged in, user files will also be listed.
If you want to list the sections in the specified category, you can add the corresponding drive letter after the DIR command, such as DIR C: etc.

6: List the topic list in the section:
You can add the corresponding drive letter and path after the DIR command, such as C:\1, etc. If you want to list all topics, you can add the /A switch. The switches of the DIR command can be viewed with DIR /?, or can be specified in the %DIRCMD% environment variable.

7: Display topic content:
The TYPE or MORE command can be used to view the content in the specified topic, such as TYPE C:\1\2 (if the current directory is C:\1, you can directly enter TYPE 2). At the same time, you can specify the starting post and the number of posts to display in the topic. Please refer to the parameters of the TYPE or MORE command for details.

8: Post/reply or edit a post
These can all be completed using the EDIT command. For example, EDIT C:\1 will create a new topic in the C:\1 directory (section), EDIT C:\1\2 will reply to the C:\1\2 file (topic), EDIT C:\1\2 3 will edit the 3rd post in the C:\1\2 topic, etc. If you want to quote a reply, you can use the /R switch. For example, EDIT C:\1\2 3 /R will quote the reply to the 3rd post in the C:\1\2 topic. For more information about the switches of EDIT, you can use EDIT /? to view.
In addition, the EDIT command can also create and edit user files on drive A. Please refer to the usage instructions of the EDIT command for details.

9: Search posts
The FIND command can be used to search the subject and content of posts. For example, FIND "hello" C:\1 will search for all posts containing the string "hello" in the C:\1 directory (section). The FIND command supports many switches, such as finding posts sent by a specified user, displaying the matching lines, displaying all lines of the matching post, searching case-insensitively, searching the string only in the subject, etc. For details, you can use FIND /? to view.
In addition, the FIND command can also search the user files on drive A and the content in the user's private messages.

10: Send and receive private messages
The NET SEND command can be used to send private messages. The usage is NET SEND username. The user's inbox and outbox are all independent drives, which can be seen in the drive list of drive A (the inbox is drive G, and the outbox is drive H). You can use commands such as DIR, TYPE/MORE, FIND in these drives to list, view, search private messages, etc. You can also use the form "NET SEND RE filename" to quote and reply to private messages.

11: Subscribe to topics
The NET FILE command can be used to view the currently subscribed topics. If you want to add or delete the subscribed content, you can add the ADD or DEL parameters respectively. Please refer to the usage of the NET command for details.

12: View user information and status
The NET USER and NET VIEW commands can be used to view the personal information and online status of the specified user respectively. If no user name is added, the user's own information and the online status of all users will be displayed respectively.

13: View forum information
The NET GROUP and NET STATISTICS (can be abbreviated as NET STATS) can be used to view the user group information of the forum and the forum statistics data respectively.

14: Operate user files
You can use commands such as DIR, TYPE/MORE, EDIT, FIND, REN, DEL to operate the user files on drive A (equivalent to the user's personal file storage space). At the same time, users can also directly create or execute BAT batch files.

Part 4: Command Explanation

When the HELP command is entered in the DOS command prompt interface, the following commands can be seen:

BREAK, CD/CHDIR, CHCP, CLS, CMD, COLOR, DATE, DEL/ERASE, DIR, ECHO, EDIT, EXIT, FIND, FONT, GOTO, HELP, HISTORY, IF, MORE, NET, PAUSE, POPD, PROMPT, PUSHD, REM, REN/RENAME, SET, SHIFT, TIME, TITLE, TYPE, VER, VOL

You can use "HELP command name" or "command name /?" in the DOS command prompt interface to view its help. Here is a more detailed description of these commands:

BREAK
Function: Set or clear extended Ctrl+C detection.
Usage: BREAK
Explanation: Similar to DOS, when BREAK is ON (default value), the user can press Ctrl+C or Ctrl+Break command to forcibly interrupt the execution of the command itself or the batch when executing any command or batch file that needs to wait. For example, when executing the DIR or PAUSE command and pressing the Ctrl+C key, it will automatically return to the command line even if the DIR command is still sending. On the contrary, when BREAK is OFF, the user cannot use the Ctrl+C or Ctrl+Break command to forcibly interrupt the execution of the command itself or the batch. In addition, BREAK can control whether the EDIT command allows exiting by pressing the Ctrl+C or Ctrl+Break key when editing the file content.
Example: BREAK (display the current BREAK status)
BREAK ON (set extended Ctrl+C/Ctrl+Break detection)
BREAK OFF (clear extended Ctrl+C/Ctrl+Break detection)

CD (or CHDIR)
Function: Display and change the directory.
Usage: CD
Explanation: Similar to DOS/CMD, this command can display or modify the current path. In addition, when the parameter only includes the drive letter, this command will enter the specified drive, which is the same as in SFTP. CHDIR and CD commands have the same function.
Example: CD (display the current path)
CD .. (enter the parent directory)
CD C:\1 (enter the C:\1 directory)

CHCP
Function: Display or set the active code page number.
Usage: CHCP
Explanation: Similar to DOS/CMD, this command can display or modify the current active code page. This command can be used to switch the language used by the command prompt, including Simplified Chinese (936), Traditional Chinese (950), and English (437 or 850), which is consistent with CMD. The default starting code page is automatically selected according to the default language of the browser. For example, when the default language of the browser is Simplified Chinese, the starting code page is 936 (Simplified Chinese), and when the default language is Traditional Chinese, the starting code page is 950 (Traditional Chinese). Otherwise, the starting code page will be 437 (English). However, it can also be set to the corresponding code page by adding?cp=xxx parameter (where xxx is the code page to be specified, such as 437) in the URL.
Example: CHCP (display the current code page)
CHCP 437 (switch the current code page and interface language to English)
CHCP 936 (switch the current code page and interface language to Simplified Chinese)
CHCP 950 (switch the current code page and interface language to Traditional Chinese)

CLS
Function: Clear the screen.
Usage: CLS
Explanation: Similar to DOS/CMD, this command will clear the content on the screen. In addition, the same effect can be achieved by using the Ctrl+Del shortcut key.
Example: CLS (clear the screen)

CMD (or COMMAND)
Function: Start or refresh the command interpreter.
Usage: CMD
Explanation: The CMD command is automatically called when the DOS command prompt interface is started. Adding the /P parameter will automatically execute the commands in the A:\AUTOEXEC.BAT batch file.
Example: CMD /P (will execute the commands in the A:\AUTOEXEC.BAT batch file)

COLOR
Function: Set the color (foreground and background color) of the command prompt.
Usage: COLOR
Explanation: Similar to CMD, the parameter of the COLOR command consists of two hexadecimal digits, which respectively set the foreground and background colors of the DOS command prompt interface. If no parameter is added, the default value will be restored.
Example: COLOR 07 (or COLOR 7, set the color to black background and white text, which is the same as the default value of COLOR)

DATE
Function: Display the current date.
Usage: DATE
Explanation: This command will display the current date. In addition, when the %DATE% environment variable is not manually set, %DATE% will automatically expand to the current date, which is consistent with CMD.
Example: DATE (display the current date)

DEL (or ERASE)
Function: Delete files.
Usage: DEL filename
Explanation: Similar to DOS/CMD, the DIR command is used to delete files. For topic files, the user must have administrative privileges to delete them; for private message files (i.e., the content in the inbox and outbox), the user can use this command to clean up their private messages as long as they are logged in. The post number 0 means the topic post, 1 means the first reply, and so on. A negative number means counting from the last post.
Example: DEL C:\1\2 -1 (delete the last post in the C:\1\2 file)
DEL G:\3 (delete the 3 file/private message on drive G)

DIR
Function: Display directory contents.
Usage: DIR attribute]] attribute]]
Explanation: Similar to DOS/CMD, the DIR command is usually used to display the files and their information in the specified directory. The range can be controlled with offset,amount. For example, 10,20 means starting from the 10th file and displaying 20 files in total. The default is 0,22, that is, the first 22 files. It can be adjusted through the offset,amount parameter or the /A switch. The DIR command supports the following switches:
/A: List all files with the specified attributes. (And the default is to only display the first 22 files)
The attributes of the /A switch can be (if not specified, it means all):
A Attachment C Closed/Locked D Drive/Directory
G Essence H Hot N New
O Ordinary P Vote T Pinned
/B: Only display the file name
/C: Display the creation date/time of the file/directory (the default is to display the last modification date/time)
/P: Display page by page (prompt to press Enter to continue after displaying 25 files each time, or press ESC or Q to exit)
/S: Also display the content in subdirectories
/V: View customization mode. All information about the specified item will be displayed if possible.
The items supported by the /V switch can be (if not specified, it means all):
A Attribute D Date/time I ID
N Name/Title P Poster/Moderator R Record

In addition, a /W switch is reserved for compatibility but will be ignored.
The attributes of the /A and /V switches can be combined freely to display the corresponding content. A colon can be added between the switch and the option, or it can be omitted. For example, /AFG and /A:FG have the same effect. Using the /V switch can display the attributes, view count, reply count, author, poster, the total number of files and posts in the section, the moderator, etc. of the file/topic. Users can use various attributes of the /V switch to customize the display style, such as not displaying some information to save screen space, etc. Among them, the attributes of the file can be <DIR> (directory/section), <Top> (pinned post), <New> (new post or new message), <Essence> (essence post), <Vote> (vote post), <Locked> (closed/locked post), <Hot> (hot post), <Att> (post with attachment).
If a - character is added before the switch (such as /-A, /-V, etc.), it means canceling the switch. In addition to using it on the command line, these switches can also be pre-specified in the %DIRCMD% environment variable. The default value of %DIRCMD% is /P /V, which can be modified with the SET command, or the - character can be added on the command line (such as /-V) to cancel the specified switch. Except for the default value of %DIRCMD%, these are all consistent with DOS/CMD.
Example: DIR A: /B (only display the names of all files on drive A)
DIR C:\1 /AHT /P (display all pinned or hot files/posts in C:\1 page by page)
DIR C:\1 20,30 (display the files in C:\1, starting from the 20th file and displaying 30 files in total)
DIR C: /A/S/-V (display all files on drive C, including the content in subdirectories, but not display detailed information such as the poster)

ECHO
Function: Display text, or turn on and off command echo.
Usage: ECHO or ECHO
Explanation: Similar to DOS/CMD, ECHO can be used to display the specified text, and can also be used to display or set command echo. When ECHO is ON, the system will echo the current prompt and command. When ECHO is OFF, the opposite is true. Usually, adding @ECHO OFF in the batch file can make the system not display the commands executed in the batch file.
Example: ECHO (display the current ECHO status)
ECHO Hello everyone! (display "Hello everyone!")
ECHO. (display an empty line)
ECHO ON (turn on command echo)
ECHO OFF (turn off command echo)

EDIT
Function: Start the file editor to create and edit files, which can be used for posting, replying, modifying posts, etc.
Usage: EDIT path | filename
Explanation: Similar to DOS/CMD, the EDIT command can be used to edit files. The user must be logged in to use this command. The path can be either a relative path or an absolute path. If the file name is not specified, it means creating a new file in the specified path (i.e., posting a new topic). Otherwise, it means editing the file (including replying and modifying posts). If the post number is specified, EDIT will open the corresponding post in the topic for the user to edit (i.e., modifying the post). Otherwise, it means replying in the topic. The post number 0 means the topic post, 1 means the first reply, and so on. A negative number means counting from the last post. The EDIT command can also be used to create or modify the file on drive A, such as the A:\AUTOEXEC.BAT batch file. In addition, if the value of the %AUTOSUB% environment variable is positive, the edited file (topic) will be automatically subscribed.
The EDIT command supports the following switches:
/D: Disable Discuz! code (enabled by default).
/I: Ignore the points and time restrictions of the post.
/R: Quote the reply post in the file (if the post number is not specified, it defaults to replying to the topic post).
/S: Do not use the personal signature (use by default).
/T: Automatically append the edit date and time after the post when editing the post.
/U: Disable URL recognition (enabled by default).

Example: EDIT A:\AUTOEXEC.BAT (edit the A:\AUTOEXEC.BAT file)
EDIT C:\1 (post a new topic in the C:\1 section)
EDIT C:\1\2 (reply to the C:\1\2 topic)
EDIT C:\1\2 1 /T (edit the 1st reply in the C:\1\2 topic and automatically append the edit date and time after the post)
EDIT C:\1\2 2 /R (quote the reply to the 2nd reply in the C:\1\2 topic)
EDIT C:\1\2 -2 /S (edit the second last reply in the C:\1\2 topic and do not use the personal signature)

EXIT
Function: Return to the graphical interface.
Usage: EXIT
Explanation: This command will return to the graphical interface of the forum.
Example: EXIT (return to the graphical interface)

FIND
Function: Find the specified text in the file.
Usage: FIND "string" | filename
Explanation: The path is used to specify the range of the file to be searched. If the file name is not specified, all files in the path will be searched. The range can also be controlled with offset,amount (the same as the DIR command. For example, 10,20 means starting from the 10th file and searching 20 files in total; if not specified, it means all files). If the post number is specified, FIND will only search from the specified post in the file (topic), otherwise it will search from all posts in the topic. The post number 0 means the topic post, 1 means the first reply, and so on. A negative number means counting from the last post. The string is the string to be searched, enclosed in quotes, and there can be spaces in it. By default, all lines in the file that match the string will be displayed, but it can be adjusted through switches (most are consistent with DOS/CMD):
/A: Display all lines in the post with the specified string
/I: Ignore the case of the string
/C: Only display the number of lines in the file that match the string
/N: Only display the file name that matches the string
/S: Only search the string in the title
/U: Display the content of the post sent by the specified user (if the post number is 0, it means only find and display the topic post sent by the specified user; by default, it searches from the topic post and all reply posts)
/V: Only display all lines that do not match the string.
Example: FIND "ECHO" A:\AUTOEXEC.BAT /V (find and display all lines in the A:\AUTOEXEC.BAT file that do not contain the string ECHO)
FIND "hello" C:\1\2 /N (search for the string hello in the C:\1\2 file, and if it contains this string, display this file name)
FIND "USER" C:\1 0 /U /I (search for all topics sent by USER in the C:\1 directory, and do not distinguish the case of the user name)
FIND "HELLO" C:\8 0,20 4 /A/I/N (in the first 20 files in the C:\8 directory, find and display all posts that contain the string HELLO and are the 4th reply, and do not distinguish the case)

FONT
Function: Display all available fonts or change the current font.
Usage: FONT LIST or FONT or FONT
Explanation: FONT LIST can display the list of all available fonts. FONT will change the current font. The font can be either the font name or the corresponding ID (i.e., the ID seen with the FONT LIST command). For example, 1 represents Courier, 2 represents FixedSys (the default font in CMD), etc. FONT is used to set the line spacing, where the value ranges from 0 to 100.
Example: FONT (display the current font)
FONT LIST (display all available fonts)
FONT FixedSys (change the current font to FixedSys, which has the same effect as FONT 2)
FONT 50% (set the line spacing to 50%)

GOTO:
Function: Jump to a specified label in the batch.
Usage: GOTO label
Explanation: Similar to DOS/CMD, the GOTO command will make the batch file jump to the specified label. In addition, using GOTO :EOF will automatically jump to the end of the batch file, which is consistent with CMD.
Example: GOTO next (assuming there is a :next line in the batch file, GOTO next will jump to this line)

HELP
Function: Provide command help information.
Usage: HELP
Explanation: Similar to CMD, the HELP command will display the help of the specified command, or you can also use the simpler form "command name /?". If no parameter is added, the HELP command will display the list of all commands.
Example: HELP (display the command list)
HELP DIR (display the help of the DIR command, which has the same effect as DIR /?)

HISTORY
Function: Display the command line history.
Usage: HISTORY
Explanation: This command will display the commands entered by the user in the DOS command prompt interface. You can use the arrow keys and PageUp, PageDown to call the previously entered commands, which is consistent with DOS and CMD environments loaded with DOSKEY.
Example: HISTORY (display the command line history)

IF
Function: Complete conditional processing.
Usage: IF ERRORLEVEL value command
IF string1==string2 command
IF EXIST filename command
Explanation: Similar to DOS/CMD, the IF command is used for conditional judgment, including judging whether the current ERRORLEVEL value is greater than or equal to the specified value, whether the specified strings are equal, and whether the specified file exists. NOT means negation. In addition, the IF command can usually be nested.
Example: IF NOT ERRORLEVEL 1 ECHO Success! (display the specified information when ERRORLEVEL is 0)
IF %USERNAME%==Hello DIR (run the DIR command when %USERNAME% is Hello)
IF EXIST C:\1\2 TYPE C:\1\2 (display the content of the C:\1\2 file when the C:\1\2 file exists)
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 PAUSE (pause when ERRORLEVEL is exactly 1)

MORE
Function: Display the content of the file, and prompt to press any key to continue to display the next post after displaying the content of one post.
Usage: MORE filename
Explanation: The MORE command is very similar to the TYPE command, but the MORE command will prompt to press the Enter key to continue to display the content of the next post after displaying the content of one post in the topic, or press the ESC or Q key to exit. The path can be either a relative path or an absolute path. If the post number is specified, MORE will only display the corresponding post in the topic, otherwise it will display all posts in the topic. The post number 0 means the topic post, 1 means the first reply, and so on. A negative number means counting from the last post. The switches /A, /D, /P, /S are respectively used to not display the attachment, disable Discuz! code, not display the voting result, not display the personal signature, and the usage is consistent with the TYPE command.
Example: MORE A:\AUTOEXEC.BAT (display the content of the A:\AUTOEXEC.BAT file)
MORE C:\1\2 (display all posts in the C:\1\2 topic, and prompt to press a key to continue to display the content of the next post after displaying the content of one post)
MORE C:\1\2 3,4 /S (start displaying 4 posts from the 3rd reply in the C:\1\2 topic, and do not display the personal signature)

NET
Function: Manage the current user.
Usage: NET
or NET FILE
or NET LOGON username password
or NET SEND user1,
or NET SEND FOR|RE filename
or NET USER
or NET VIEW
Explanation: The NET command is used to operate the current user, including user login/logout, displaying user status and information,
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
topdzw +1 2009-12-23 14:06
zzz19760225 +2 2017-08-30 13:14
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 2 Posted 2007-01-17 22:30 ·  中国 山西 运城 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
good!

However, my earliest idea was to make the command line into a multi-language version

Use chcp to switch language versions

But considering that it may require major changes to the kernel

I don't have a particularly strong need either

So it was later abandoned
Floor 3 Posted 2007-01-18 00:01 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Great! Support!
Floor 4 Posted 2007-01-18 04:30 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by qzwqzw at 2007-1-17 09:30 AM:
good!

However, my earliest idea was to make the command line into a multi-language version

Use chcp to switch language versions

But considering that it may require major changes to the kernel

I don't have a strong need myself

So it ended up being dropped later


I suddenly thought of this this morning, and it turns out we thought of the same thing :-) But at that time, it was just a sudden idea. I didn't originally plan to implement it for real, but after seeing this post, I decided to give it a try. The main difficulty is that there are too many contents to be localized, and it seems quite difficult to achieve 100% localization. Let's try this version first (for example, enter chcp 936 to see):

http://www.cn-dos.net/forum/cmdprmt.php
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 5 Posted 2007-01-18 04:33 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Does it support `export lang=zh_CN.UTF-8`?

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 6 Posted 2007-01-18 05:14 ·  中国 山西 运城 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
better!

Briefly looked at it

No problems found

If you think it's relatively complete

It is suggested to set the default code page to 936

Code pages like 437 or others can be customized by the user in Autoexec.bat
Floor 7 Posted 2007-01-18 08:24 ·  中国 上海 闵行区 电信
中级用户
★★
大师兄
Credits 377
Posts 99
Joined 2005-08-26 07:37
20-year member
UID 41945
Status Offline
Suggest this post be pinned!
In addition, is there a document similar to "WhatsNew" so that old users can quickly learn about the new features of the new version.
Floor 8 Posted 2007-01-18 08:33 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
I don't know how to write the command line, and I want to know this
Floor 9 Posted 2007-01-18 17:20 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by qzwqzw at 2007-1-17 04:14 PM:
better!

Briefly looked at it
No problems found
If you think it's relatively complete
It is recommended to set the default code page to 936
Code pages like 437 or others can be customized by the user in Autoexec.bat


Just did a relatively comprehensive Chinese localization on it, and now the default code page has been set to 936. However, users can add parameters in the URL to force the initial code page to be specified as 437, for example:

http://www.cn-dos.net/forum/cmdprmt.php (The initial code page will be the default value 936)
http://www.cn-dos.net/forum/cmdprmt.php?cp=437 (The initial code page will be 437)

At the same time, the CHCP command can be used at any time in AUTOEXEC.BAT or on the command line to switch the code page and interface language. In batch files, the %CODEPAGE% environment variable can be used to determine the current code page.

------

Originally posted by tigerpower at 2007-1-17 07:24 PM:
It is recommended to pin this post!
In addition, can there be a document similar to "WhatsNew" so that old users can quickly learn about the new features of the new version.


Well, it will be pinned after the full text is written. I just added a brief update description about the latest version 3.4 in the development instructions part of the top floor, and the update history of subsequent versions will also be recorded. It may not be possible for previous versions.

------

Originally posted by vkill at 2007-1-17 07:33 PM:
I don't know how the command line is written, I want to know this


Not quite sure what you mean?
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 10 Posted 2007-01-18 23:04 ·  中国 山西 运城 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
Found a small issue

After typing or more-ing some posts (such as 26674#4)

The indentation in the display is not fully restored

If you repeatedly type d:\23\26674 4, the indentation effect will keep accumulating

It is speculated that it is because the post uses unclosed or incorrect Discuz! code
Floor 11 Posted 2007-01-19 01:15 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by qzwqzw at 2007-1-18 10:04 AM:
Found a small problem

After typing or moreing some posts (such as 26674#4)

The indentation in the display is not completely restored

If you repeatedly type d:\23\26674 4, the indentation effect will be accumulated continuously

It is guessed that this is because the post uses unclosed or incorrect Discuz! code


I first tried to view this post under IE7 and Firefox, but no problem was found. Then I tested it under Opera 9 and only then did I find that this situation occurred. It can be seen that this is a phenomenon unique to the Opera browser.

Then I took a look and found that it was exactly because the poster did not use the Discuz! code correctly. He first used the code, but did not use to close it, but used in the end in an incorrect form, resulting in the code not being closed actually, causing the Opera browser to fail to parse it correctly and the problem occurred. So, I adopted the method of forcibly adding the tag to close the font adjustment in the program. In this way, there should be no such phenomenon on Opera, and you can try it again:

http://www.cn-dos.net/forum/cmdprmt.php
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 12 Posted 2007-01-19 18:36 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Now the two major parts of the article, function introduction and basic operation, have been completed, and the update history since the 3.0 official version has been written based on memory. It will be pinned to the top according to lxmxn's suggestion soon. Everyone is requested to read it before use. If there are any questions or suggestions, please also post here.

In addition, the last remaining content in the command prompt from yesterday has also been completely localized.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 13 Posted 2007-01-20 09:05 ·  中国 山西 运城 联通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re Wengier:

It's really a very distinctive interface. I hope you can continue to carry it forward.

Not long ago, it was initially reflected, and the functions are already quite complete. But to compete with GUI web interfaces, more unique applications of CLI need to be explored, such as the realization of free scripts, the realization of pipelines and redirection, advanced application of variables, reference of client programs, etc. Some functions can also be developed in combination with network and forum characteristics, such as data interfaces to external websites and forums.

Of course, I also know that these requirements are a bit vague. Because I lack actual experience in web development and can't help you, the above suggestions are purely general remarks. You can deal with them as appropriate.

Another thing: I found that using find can't only search for the subject title, and when using full-text search, it feels that it will consume more network and server resources. And the results of dir can't know which are topics with new replies.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 14 Posted 2007-01-20 22:07 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by willsort at 2007-1-19 08:05 PM:
Re Wengier:

It's really a very distinctive interface. I hope you can continue to carry it forward.

I had a preliminary experience not long ago, and the functions are already quite complete. But to compete with GUI web interfaces, more unique applications of CLI need to be explored, such as the realization of free scripts, the realization of pipelines and redirection, advanced application of variables, reference of client programs, etc. It can also combine network and forum characteristics to develop some functions, such as data interfaces to external websites and forums.

Of course, I also know that these requirements are a bit too vague. Because I lack practical experience in web development, I can't give you a hand. The above suggestions are purely general remarks. Please handle them as appropriate.

Another thing: I found that using find can't only search for topic titles, and when using full-text search, it feels that it will consume more network and server resources. And the result of dir can't know which are topics with new replies.


First of all, I am very grateful for willsort's ideas and suggestions!

Now the /S parameter has been added to the FIND command, which can only search for titles; and in verbose mode, the DIR command will display the number of views and replies of the topic, so as to determine whether there are new replies.

Regarding pipelines, redirection, reference of client programs, etc., since they are quite complicated to implement, it may need to be slowed down. However, I will write them down and solve them respectively when conditions permit.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 15 Posted 2007-01-20 23:21 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
The enhancement of the dir function has made it convenient to collect valuable posts. However, I still want to make it more convenient to use. I wonder if it can be achieved: After adding the /a parameter to the current dir command, the same record will be displayed in two lines with line breaks. If we want to write a script to extract valuable posts according to the title, the number of replies and referring to the click-through rate, because there are a large number of parity line judgments, the efficiency of the code will be less ideal. If it can display the same record in the same line, it will be more convenient. But in this way, there may be a need to add a horizontal scroll bar (is this how it is called? I don't understand the terms of the web framework, sweat=_=!) in the web page to display the complete content, which may bring some inconvenience to web browsing. How to choose between these?

[ Last edited by namejm on 2007-1-20 at 10:22 AM ]
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
1 2 3 11 Next ›
Forum Jump: