China DOS Union

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

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

中国DOS联盟论坛
The time now is 2026-08-12 18:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Investigation and Popularization of System Commands View 1,814 Replies 13
Original Poster Posted 2008-06-23 05:06 ·  法国
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
Let's give everyone a question and also make a suggestion:

Run the following command:
dir %systemroot%\system32\*.exe /w


See if there are any internal or external commands you don't understand...

Then choose one that you don't understand yourself, try to figure it out, and then post the usage and give an example

If everyone thinks the knowledge is complete, please give it a try
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 2 Posted 2008-06-23 05:33 ·  法国
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
First, let's talk about one of the commands I don't understand (though there are many ><#!).

RSH command

Short for remote shell. Simply understood as establishing a pipeline with the remote host, sending the commands with carriage returns from the local machine to the remote host, and then echoing the response from the remote host back to the local host.


Example:
Execute the dir command on the remote host 192.168.0.1 as user Coucou

rsh 192.168.0.1 -l Coucou dir
> Connection timed out for 192.168.0.1

(I don't have a remote host here, just make do everyone)

If using redirection ">>", you need to add quotes, otherwise it will execute on your own machine

[ Last edited by PPdos on 2008-6-23 at 01:09 AM ]
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 3 Posted 2008-06-23 07:19 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
I want to know how many commands there are in total... I'm afraid I don't even know a third of them...
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 4 Posted 2008-06-23 08:13 ·  法国
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
There are more than 300 items in my XP Home Edition SP3 system.

Post another command:
sol
This command fascinates many people^^
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 5 Posted 2008-06-23 22:16 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
whoami -- This tool can be used to obtain the username and group information of the current user (access token) on the local system, as well as the corresponding security identifier (SID), privileges, and logon ID. For example, who is the currently logged - in user? If no switch is specified, the tool displays the username in NTLM format (domain\username).


Windows Server 2003
C:\>whoami /user

User information
----------------

Username SID
==================== ============================================
jinjie - 520\jinjie027 S - 1 - 5 - 21 - 2901898759 - 1882768009 - 928121960 - 500
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
PPdos +5 2008-06-23 22:20
Floor 6 Posted 2008-06-24 23:50 ·  法国
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
netsh


Collect hardware and software information about the system and information about network connections

The GUI interface is
netsh diag gui


This command is really powerful. I used it occasionally before but didn't study it carefully. Today, I was fortunate to see it again, so I'll demonstrate it for everyone:

If you don't understand, please query the help with
netsh /?


The following are examples of individual operations:

netsh firewall>show state

Firewall state:
-------------------------------------------------------------------
Configuration file = Standard
Operation mode = Disabled
Exception mode = Enabled
Multicast/broadcast response mode = Enabled
Notification mode = Enabled
Group policy version = None
Remote management mode = Disabled

Ports currently open on all network interfaces:
Port Protocol Version Program
-------------------------------------------------------------------
9 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
33191 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
15882 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
1763 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
59154 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
24358 UDP IPv4 (null)
24358 TCP IPv4 (null)
1932 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
1986 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe
56306 UDP IPv4 C:\Program Files\Windows Live\Messenger\msnmsgr.exe




C:\Documents and Settings\me>netsh diag connect 58.215.64.130 80
The following command was not found: diag connect 58.215.64.130 80.

C:\Documents and Settings\me>netsh diag connect iphost 58.215.64.130 80

IPHost (58.215.64.130)
IPHost = 58.215.64.130
Port = 80
The server appears to be running on port


In addition to connecting to a specified IP and specified port, it can also be a proxy server, mail server, etc.

C:\Documents and Settings\me>netsh diag connect

The following commands are valid:

Commands in this context:
connect ieproxy - Connect to the proxy of Internet Explorer
connect iphost - Connect to the user-specified IP host.
connect mail - Connect to the mail server.
connect news - Connect to the news server.


Show the commands at once
netsh diag>show

The following commands are valid:

Commands inherited from the netsh context:
show alias - List all defined aliases.
show helper - Please list all top-level helpers.
show mode - Display the current mode.

Commands in this context:
show adapter - Display all adapters.
show all - Display all categories.
show client - Display all network clients.
show computer - Display computer information.
show dhcp - Display the DHCP server for each adapter.
show dns - Display the DNS server for each adapter.
show gateway - Display the default gateway server for each adapter.
show ieproxy - Display the server name and port number of Internet Explorer.
show ip - Display the IP address of each adapter.
show mail - Display the mail server name and port number.
show modem - Display all modems.
show news - Display the news server name and port number.
show os - Display operating system information.
show test - Display all categories and execute all tests
show version - Display Windows and WMI versions.
show wins - Display the preferred and auxiliary WINS servers for each adapter.


It's fun too. Those who like it can post and top!

[ Last edited by PPdos on 2008-6-24 at 04:57 PM ]
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 7 Posted 2009-01-02 14:42 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
netsh can also set up the firewall. Good stuff (it's available on my computer, but not on the Internet café's computers).
Want to learn the makecab packaging tool. After looking at the Lao Maotao's work, many of those parameters are not understood.
Hope for an expert's guidance
Floor 8 Posted 2009-01-02 19:07 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
MakeCAB is a file created by Microsoft for making CAB files. For detailed MakeCAB introductions, please refer to Microsoft MSDN. The command usage provided by the system is as follows:

Microsoft (R) Cabinet Maker - Version (32) 1.00.0601 (03/18/97)
Copyright (c) Microsoft Corp 1993-1997. All rights reserved.

MAKECAB ] source
MAKECAB ] /F directive_file

source File to compress.
destination File name to give compressed file. If omitted, the
last character of the source file name is replaced
with an underscore (_) and used as the destination.
/F directives A file with MakeCAB directives (may be repeated).
/D var=value Defines variable with specified value.
/L dir Location to place destination (default is current directory).
/V Verbosity level (1..3).

If there are multiple files in a directory, then you need to write a file list file to tell MakeCAB how many files need to be packaged.
A simple list.txt file is written, which contains only 2 lines. One is libactivex.inf, and the other is libactivex.dll
Then execute:

makecab /F list.txt /D compressiontype=lzx /D compressionmemory=21 /V

The system will display the compression process and the compression result, as follows:

Microsoft (R) Cabinet Maker - Version 5.1.2600.2180
Copyright (c) Microsoft Corporation. All rights reserved..

287,395 bytes in 2 files
Total files: 2
Bytes before: 287,395
Bytes after: 162,170
After/Before: 56.43% compression
Time: 0.74 seconds ( 0 hr 0 min 0.74 sec)
Throughput: 378.76 Kb/second

After compression, a directory will be generated under the directory. Rename the files in the directory to libactivex.cab (it can be the file name you need) and it's OK.

Then it can be placed in the directory of the WEB server, and IE will prompt to download when opened.

Attachment: The generation method of INF will be introduced later.

In fact, there are 2 other ways to generate CAB files. One is to use Visual Studio, and the other is to use a special packaging tool. You can Google it.

Detailed explanations and tips for using makecab:

The simplest usage:
makecab full name of the file such as makecab wmd.dll

Specify compression type and the size of memory used:
makecab /d compressiontype=lzx /d compressionmemory=21 wmd.dll has a high compression ratio

Batch compression method:
for %v in (*.*) do makecab %v

Before, I studied for a long time and didn't know how to use one command to compress all files in a directory into a CAB package. Now I finally know that the way to compress into one CAB package is:
makecab /f list.txt /d compressiontype=mszip /d compressionmemory=21 /d maxdisksize=1024000000 /d diskdirectorytemplate=dd* /d cabinetnametemplate=dd*.cab

Here's one with a high compression ratio:
makecab /f list.txt /d compressiontype=lzx /d compressionmemory=21 /d maxdisksize=1024000000 /d diskdirectorytemplate=dd* /d cabinetnametemplate=dd*.cab

The list.txt here is the list of files. If it's a relative path, then it should be placed in the folder to be compressed. If it's an absolute path, it can be placed anywhere!
Floor 9 Posted 2009-01-04 00:18 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
精简
=> 个人网志
Floor 10 Posted 2009-01-10 14:06 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Please allow me to put such a long thing....

bootcfg Description:
This command-line tool can be used to configure, query, change or delete startup project settings in the BOOT.INI file.

charmap Character map

chkntfs Displays or modifies disk checks at startup.

cleanmgr Disk cleanup tool (under Windows)

cliconfg SQL SERVER Client Network Utility (under Windows)

clipbrd Clipboard Viewer (under Windows)

convert Convert disk to NTFS format (without deleting data)

ddeshare Share (under Windows)

defrag Defragmenter

diantz Equivalent to the makecab command, seems to be a cab packing tool

diskpart Many disk operations, don't understand

dosx Enter command state


DRIVERQUERY ]]]

Description:
Allows administrators to enumerate and display lists of installed device drivers and properties of drivers.

drwatson System Doctor (under Windows)

drwtsn32 Related to System Doctor (under Windows)

dxdiag DirectX Diagnostic Tool (under Windows)

esentutl English, completely don't understand. Seems related to databases

eventvwr Event Viewer (under Windows)

exe2bin Seems to convert EXE to Bin, never succeeded in playing around...

expand Unzip cab files
It seems (just saying seems) -f parameter seems to be used to specify unzipping one of the files

Passing by the fc command, everyone uses this to check answers when doing math exercises is the best

finger
Displays information about a user on a specified system running the
Finger service. Output varies based on the remote system.

forcedos Startup program.
Can pass parameters to the program.

Depressed freecell is FreeCell

fsquirt (under Windows) Bluetooth File Transfer Wizard, I see tooth is so familiar, it turns out to be tooth, still Bluetooth.

fsutil Good stuff, after...

getmac (don't understand)
Description:
This command-line tool enables administrators to display the
MAC addresses of one or more network cards on the system.

getresult
Description:
This command-line tool displays the result set of policies (RSoP) for the target user and computer. (Seems to be related information)

gpupdate
Microsoft(R) Windows(R) Operating System Group Policy Refresh Utility v5.1
(C) Microsoft Corporation. All rights reserved.
Description: Refreshes group policy settings.

hostname Computer name

iexpress (under Windows) File bundling thing.... Seems to be packaged in an EXE file, like an installer during setup
The first time I saw it was in a certain tutorial--Windows built-in Trojan bundling tool....

ipxroute NWLink Source Routing Control Program version 2.00.

LODCTR (don't understand) Updates performance monitor counter names and descriptions for extensible counters

Logman Manages the "Performance Logs and Alerts" service to create and manage event trace session logs and performance logs.
(Although I don't know how to play, but very "advanced" I use more combined to list, the result is one character per line... and there are beeps)

logoff Don't know until you try... try

magnify (under Windows) Magnifier

makecab Compress + package the same as the diantz mentioned above

Mem (needs to be used in command)
Displays information about allocated memory regions, available memory regions, and programs loaded into the memory in the MS-DOS subsystem. Typing mem without parameters displays the status of used and available memory in the MS-DOS subsystem.

Parameters
/program
Displays the status of programs being loaded into memory.
/debug
Displays the status of currently loaded programs and internal drivers, as well as other program information.
/classify
Displays the status of programs loaded into conventional memory and Upper Memory Area (UMA).
/?


mmc Path\filename.msc

Parameters
Path\filename.msc
Starts MMC and opens the saved console. The full path and filename of the saved console file need to be specified. If no console file is specified, MMC will open a new console.
/a
Opens the saved console in author mode. Used to make changes to the saved console.
/64
Opens the 64-bit version of MMC (MMC64). Only used when running Windows XP 64-Bit Edition.
/32
Opens the 32-bit version of MMC (MMC32). When running Windows XP 64-Bit Edition, you can use this command-line option to open MMC to run 32-bit snap-ins.



mountvol (Good stuff....) Creates, deletes, or lists volume mount points.

mplay32 Windows built-in music player, File - Open - discovers Windows sound audio files, such as shutdown
In the windows\media directory

mkbkup Seems to be for backup and restore, don't know how to use.

mqsvc Don't know what it is The list of that string is very unique

mrinfo -n Displays IP addresses in numeric format
-i address Local interface address to send the query
-t seconds Timeout for IGMP queries (in seconds) (default is 3 seconds)
-r retries Additional number of SNMP queries to send (default is 0)

msg (System dialog) Sends messages to users

mshearts Online Hearts

msiexec Installation options

narrator Windows Narrator

nslookup Displays information that can be used to diagnose the Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The Nslookup command-line tool can only be used if the TCP/IP protocol is installed.

ntbackup (under Windows) Backup tool

ntsd All English, it is said to be a tool other than taskkill to force close processes, I don't know.

openfiles Description:
Allows administrators to list or interrupt open
files and folders on the system.

osk Different from the screen keyboard I have seen before Very beautiful (don't know if it is related to the system version)

packager (under Windows) Object Packager seems to be able to change icons

pentnt English, completely don't know

proxycfg -? : View help information

proxycfg : View current WinHTTP proxy settings

qprocess Another way to list processes

qwinsta Session...

racmgr32 (under Windows) Remote Automation Connection Program

replace Replace files I forgot there was this command

rtcshare (under Windows) Shared session

runas Allows users to run specified tools and programs with other permissions instead of the permissions provided by the user's current login.

sigverif (under Windows) File Signature Verification

syncapp (Create a My Briefcase on the desktop)

sysedit (under Windows) System Configuration Editor

tsdiscon Goes to the logoff screen but doesn't log off...

tsshutdn Shuts down, feels good

verifier (under Windows) Completely don't understand

winchat (under Windows) Chat
Floor 11 Posted 2009-01-10 15:57 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
If some application examples and switch explanations can be provided, it will be even better.
Floor 12 Posted 2009-01-14 09:24 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
I broke my promise and came online again...

I don't know myself, I just tried one by one and read the instructions.

By the way, there is a "I Love Batch Processing - Special Tutorial" that extracts help tutorials online.

I have a cloud disk hidden at 523066680.ys168.com, in the last folder
Floor 13 Posted 2009-01-29 21:38 ·  中国 广东 广州 花都区 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
It seems that chatting about commands one by one is more interesting.

I used mqsvc to list a table, and I have no idea what that thing is. Which expert is willing to analyze it for me?

Thanks in advance.
Floor 14 Posted 2009-10-22 15:32 ·  中国 广东 广州 白云区 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
The w32tm command is not bad, everyone can study it~
Forum Jump: