命令行的使用 command line
2012-10-29 21:00
246 查看
命令行命令列表:
http://ss64.com/nt/例子1:
@echo off set kobradir="C:\Program Files\Reuters\Kobra\Program" set kobra="kobra.exe" set kobraconfig="C:\Program Files\Reuters\Common\Config\RFA.RFA-configuration-file" rem check the file whether exist if exist %kobraconfig% goto checkPTNConfig echo No found RFA.RFA-configuration-file goto end :checkPTNConfig if exist %kobraconfig%_PTN goto checkIINConfig echo No found RFA.RFA-configuration-file_PTN goto end :checkIINConfig if exist %kobraconfig%_IIN goto install_prompt echo No found RFA.RFA-configuration-file_IIN goto end rem consult the network which want? :install_prompt set /p a=Please choose which network you want to access to? Continue [PTN/IIN]? if /i '%a:~0,3%'=='PTN' goto Change2PTN if /i '%a:~0,3%'=='IIN' goto Change2IIN echo Invalid user input... goto install_prompt :Change2PTN del /f /s /q %kobraconfig% > nul copy /Y %kobraconfig%_PTN %kobraconfig% echo Change to PTN : Done goto end :Change2IIN del /f /s /q %kobraconfig% > nul copy /Y %kobraconfig%_IIN %kobraconfig% echo Change to IIN : Done goto end rem shutdown the kobra taskkill /f /im %kobra% :waitforstop ping -n 5 127.0.0.1 >nul tasklist | find /i "kobra.exe" > nul && goto waitforstop rem start the kobra %kobradir%\%kobra% :end pause
Windows Service 使用技巧
常用命令sc query - Enumerates status for active services & drivers
sc query messenger - Displays status for the messenger service
sc queryex messenger - Displays extended status for the messenger service
sc query type= driver - Enumerates only active drivers
sc query type= service - Enumerates only Win32 services
sc query state= all - Enumerates all services & drivers
sc query bufsize= 50 - Enumerates with a 50 byte buffer
sc query ri= 14 - Enumerates with resume index = 14
sc queryex group= \"\" - Enumerates active services not in a group
sc query type= service type= interact - Enumerates all interactive services
sc query type= driver group= NDIS - Enumerates all NDIS drivers
快速显示网络连接状态的命令(open the network connections in command) supproted by windows xp, vista, 7, 2003server, 2008server.
ncpa.cpl
控制面板其他命令
Accessibility Options access.cpl Add/Remove Programs appwiz.cpl Add Hardware Wizard hdwwiz.cpl Administrative Tools admintools Automatic Updates wuaucpl.cpl Bluetooth Properties bthprops.cpl Control Panel panel Desktop Properties desktop Desktop Appearances Properties color Display Properties desk.cpl Fastfind Properties findfast.cpl Firewall Properties firewall.cpl Fonts Folder fonts Game Controllers joy.cpl Infrared Properties infrared Internet Options inetcpl.cpl iSCSI Initiator iscsicpl.cpl Java Control Panel jpicpl32.cpl Keyboard Properties main.cpl keyboard Licensing Mode liccpa.cpl Mouse Properties main.cpl Network Connections ncpa.cpl Network Setup Wizard netsetup.cpl ODBC Properties odbccp32.cpl Power Options powercfg.cpl Printers Folder printers Regional and Language Options intl.cpl Scanners and Camera Properties sticpl.cpl Schedule Tasks schedtasks Sound and Audio Devices mmsys.cpl Stored Passwords keymgr.cpl System Properties sysdm.cpl Telephone and Modem Properties telephon.cpl Time and Date Settings timedate.cpl User Accounts nusrmgr.cpl User Accounts Advances userpasswords2 User Passwords userpasswords Windows Security Center wscui.cpl Wireless Link irprops.cpl
复制文件夹
复制相对路径文件,相对路径需要使用双引号来括住。
if not exist d:\cmp\temp mkdir d:\cmp\temp
xcopy /Y /E "../conf" d:\cmp\temp
copy /Y /E "../conf" d:\cmp\temp
两者区别是xcopy可以递归的复制源文件下的子文件夹。
创建新文件
copy nul newfile.txt > nul
命令行睡眠
可以使用ping 127.0.0.1 –n num来决定睡觉几秒ping 127.0.0.1 -n 3 >nul
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
相关文章推荐
- 使用VLC命令行做流化:Streaming HowTo/Command Line Examples
- MFC使用CCommandLineInfo处理命令行
- 【Gradle Build Tool 4.1用户指南】Chapter 4. Using the Gradle Command-Line 第4章 使用Gradle命令行
- 使用NDK编译并运行C++11的Command line命令行程序
- c++ ---------命令行获得和转换文件CommandLineToArgvW和GetCommandLineW()的使用
- .NET混淆器Dotfuscator使用教程:命令行(Command Line)
- python 命令行使用(command line options usage)
- 使用命令行 Subversion 访问项目源文件(转自:http://www.open.collab.net/nonav/scdocs/ddUsingSVN_command-line.html.zh)
- MySQL 5.7 MySQL command line client 使用命令
- MySQL 5.7 mysql command line client 使用命令详解
- 使用命令行工具管理Android项目(Managing Projects from the Command Line)
- Windows、linux系统使用命令提示符功能(cmd,command,又称命令行)详细图文教程和手册下载
- 第三十一章 SpringBoot使用CommandLineRunner
- mysql5.5安装成功后无法使用MySQL 5.5 Command Line Client的问题
- Beginning the Linux Command Line--第2章 完成基本命令行任务
- mysql command line client 使用命令
- (用命令行部署infopath Form )Deploy administrator-approved form templates using command line
- CommandLineParser使用
- GetCommandLine 获取当前进程的命令行字符串 对字符串进行分割
- 命令行(The Command Line is Your Best Friend)