From the web looking for Java to execute the cmd command article, excerpt a paragraph.
JavaRuntime.getruntime (). EXEC (COMMANDSTR) can invoke the Execute CMD command.
Cmd/c dir is a closed command window after executing the dir command.
cmd/k dir does not close the command window after the dir command is executed.
cmd/c start dir will open a new window and execute the dir instruction, the original window will be closed.
cmd/k start dir will open a new window and execute the dir instruction, the original window will not be closed.
You can use CMD/view help information.
★CMD Command ★
1. Gpedit.msc-----Group Policy
2. Sndrec32-------Recorder
3. Nslookup-------IP Address detector
4. Explorer-------Open Resource Manager
5. Logoff---------Logout command
6. Tsshutdn-------60 seconds Countdown shutdown command
7. Lusrmgr.msc----native Users and Groups
8. Services.msc---Local Service settings
9. oobe/msoobe/a----Check if XP is active
Notepad--------Open Notepad
cleanmgr-------Waste Finishing
Start Messenger Service----. Net start Messenger
Compmgmt.msc---Computer Management
. net stop Messenger-----Stop messenger Service
Conf-----------start NetMeeting
Dvdplay--------DVD Player
Charmap--------Start character mapping table
Diskmgmt.msc---Disk governance utility
Calc-----------Start-Up calculator
Dfrg.msc-------Disk Defragmenter
Chkdsk.exe-----CHKDSK disk Check
DEVMGMT.MSC---Device Management unit
regsvr32/u *.dll----Stop DLL file run
DRWTSN32------System Doctor
Rononce-p----15-second shutdown
DxDiag---------Checking DirectX information
Regedt32-------Registry Editor
Msconfig.exe---System Configuration Utility
Rsop.msc.-------Group Policy Result set
Mem.exe--------Show Memory usage
Regedit.exe----Registration Form
Winchat--------XP comes with LAN chat
ProgMan--------Program governing device
WINMSD---------System Information
PERFMON.MSC----Computer Performance monitoring Program
2.36. Winver---------Check the Windows version
Sfc/scannow-----Scan Errors and recover
Taskmgr-----Task Manager (2000/xp/2003?
Winver---------Check the Windows version
Wmimgmt.msc----Open windows Governance Architecture (WMI)
Wupdmgr--------Windows Update
wscript--------Windows Script Host Settings
. Write----------WordPad
WINMSD---------System Information
Wiaacmgr-------Scanner and Camera Wizard
Winchat--------XP comes with LAN chat
Mem.exe--------Show Memory usage
Msconfig.exe---System Configuration Utility
Mplayer2-------Easy widnows Media Player
MSPaint--------Drawing Board
Wuyi mstsc----------Remote Desktop Connection
Mplayer2-------Media Player
Magnify--------Magnifier Utility
The. MMC------------Open the console
Mobsync--------Synchronization Command
DxDiag---------Checking DirectX information
DRWTSN32------System Doctor
DEVMGMT.MSC---Device Management unit
Dfrg.msc-------Disk Defragmenter
Diskmgmt.msc---Disk governance utility
DCOMCNFG-------Open System Component Services
DdeShare-------turn on DDE sharing settings
Dvdplay--------DVD Player
. net stop Messenger-----Stop messenger Service
The. Net start Messenger----Start Messenger Service
Syncapp--------Create a briefcase?
Sysedit--------System Configuration Editor?
Sigverif.-------File Signature Validator?
SNDREC32-------tape recorder?
SHRPUBW--------Create a shared folder?
Secpol.msc-----Local Security policy?
SYSKEY---------System encryption, once encryption can not be unlocked, to protect the Windows XP system dual password?
Services.msc---Local Service settings?
Bayi. Sndvol32-------Volume control program?
Sfc.exe--------System File Checker?
Sfc/scannow---Windows File Protection?
TSSHUTDN-------60-second countdown shutdown command?
3.84. Tsshutdn-------60 seconds Countdown shutdown command?
Tourstart------XP profile (Travel XP program that appears after installation)?
Taskmgr--------Task Manager?
EVENTVWR-------Event Viewer?
Eudcedit-------Word-of-word procedure?
The. Explorer-------Open the resource Manager?
Packager-------Object Wrapping program?
PERFMON.MSC----Computer performance monitoring program?
ProgMan--------Program Manager?
Regedit.exe----Registration form?
94. rsop.msc-------Group Policy result set?
Regedt32-------Registry Editor?
Rononce-p----15 seconds off?
regsvr32/u *.dll----Stop DLL file to run?
98. regsvr32/u zipfldr.dll------Cancel zip support?
Cmd.exe--------cmd command prompt?
Chkdsk.exe-----chkdsk disk check?
101. Certmgr.msc----Certificate Governance utility?
102. Calc-----------start calculator?
103. Charmap--------start Character Map?
104. CLICONFG-------SQL SERVER Client Network Utility?
CLIPBRD--------Clipboard Viewer?
106. conf-----------start NetMeeting?
107. Compmgmt.msc---computer governance?
108. cleanmgr-------Garbage disposal?
109. Ciadv.msc------Indexing Service program?
OSK------------Open the On-screen keyboard?
111. ODBCAD32-------ODBC data source governance?
oobe/msoobe/a----Check if XP is active?
113. Lusrmgr.msc----native users and groups?
Logoff---------logout command?
IExpress-------Trojan * * * tool, System comes with?
Nslookup-------IP address detectors?
117. Fsmgmt.msc-----shared Folder Manager?
118. Utilman--------Auxiliary tool Manager?
119. Gpedit.msc-----Group Policy?
Explorer-------Open Resource Manager
Javac actually executed just no output execution results because you didn't output the part of the execution result
If you execute Runtime.getRuntime.exec ("cmd");
Java Execute cmd command