windows常用DOS

简介:

cmd = win+R 打开命令行
C:\Users\Administrator>gpresult /r看PC是否登录域的
C:\Users\Administrator>rsop.msc查看获取登录/注销脚本

cls  清屏
notepad   打开记事本

control userpasswords2 添加用户、修改密码

clac  打开计算机
mstsc  远程桌面
regedit  注册表
control  控制面板
ncpa.cpl  快速进入网上邻居
appwiz.cpl  添加和删除程序
firewall.cpl  防火墙
compmgmt.msc   管理
gpedit.msc  组策略
taskmgr     任务管理器
mspaint    画图板
hdwwiz 添加本地硬件
write   写字板winmsd-----系统信息
osk   打开屏幕键盘
iexpress   木马捆绑工具,系统自带
services.msc 服务
alt+prisc = ctrl+prisc 截图

systeminfo 查看系统运行时间


shutdown -s(关闭) -t(多长关闭) 64000 -r(重启) -a(放弃关闭)
at 22:00 shutdown -s #添加定时关机的计划任务
at 1 /delete #取消id为1的计划任务
at /delect #取消所有计划任务

*代表所有  *.*
cd ..返回上行
dir/ah  ;显示隐藏文件
dir/s d:\*.rmvb  >c:\dianying01.txt
del/s/f/q    c:\*.rmvb  ;删除所有C盘上的rmvb的电影。
dir *.exe
dir /p 分屏显示
dir /w
dir /a
attrib 查看属性
attrib *h 隐藏文件
attrib -h
tree /F
format c:    格式化
net user 用户名 密码 /add 建立用户auto.exec文件里
call c:\5.bat

netstat -an > aaa.txt
ping www.baidu.com >> ping.txt 追加...

netstat -an > c:\aaa.txt
dir && tree

copy con file_exsit.bat 创建文件

ctrl + z
type txt文件 打开文件
copy txt文件 复制文件

move 移动文件
md  f:\aa..\
md  d:\bb..\
for  /l  %a  in  (1,1,1000)    do   md  eijing

dir/ah  ;显示隐藏文件
dir/s d:\*.rmvb  >c:\dianying01.txt
del/s/f/q    c:\*.rmvb  ;删除所有C盘上的rmvb的电影。

goto 是流程控制转向命令

@echo on
type a.txt
echo 现在关闭命令显示!!!
goto last
dir
type a.txt
:last
dir a.txt

@echo off
set xxx="c:/"
echo 显示所有以字母x开头的变量....
set x
dir /w %xxx%
rem 删除名为xxx的变量
set xxx=
pause
type a.txt

@echo off
echo 正在自动创建批处理
echo echo进入auto.bat批处理文件中...
echo type a.txt >auto.bat
echo dir /b /w >>auto.bat
echo 被自动创建的auto.bat文件内容如下:
type auto.bat
echo
echo 排序后的auto.batu:
sort /auto.bat

@echo off
echo 正在测试是否可以ping通主机8.8.8.8...
:again
ping 8.8.8.8 >nul
if not%errorlevel%EQU 0 goto again
start "可正常与主机通信"echo 现在可以正常ping通主机8.8.8.8

pushd e:\vmare
dir /ad/b
popd

regedit /s temp.reg
del /q/f temp.reg >nul

clearpassword.bat

@echo off
echo.
echo正在删除系统中当前使用的sam文件及相关注册表文件....
eho.
del c:\windows\system32\config\sam /f/q>nul
del c:\windows\system32\config\system /f/q>nul
del c:\windows\system32\config\software /f/q>nul
del c:\windows\system32\config\security /f/q>nul
del c:\windows\system32\config\default /f/q>nul
echo正在复制系统的备份SAM文件及相关注册表文件....
echo.
copy c:\windows\system32\config\sam c:\windows\system32\config\ >nul
copy c:\windows\system32\config\system c:\windows\system32\config\ >nul
copy c:\windows\system32\config\software c:\windows\system32\config\ >nul
copy c:\windows\system32\config\security c:\windows\system32\config\ >nul
copy c:\windows\system32\config\default c:\windows\system32\config\ >nul
echo 成功清除windows所有账号密码信息,现在重启机器即可直接进入windows系统

if语句
if [not] errorlevel number command
if [not] exist filename command 根据文件的存在执行命令行

@echo off
dir C:
if errorlevel 1 goto 1
if errorlevel 0 goto 0
:0
goto exit
echo "命令执行成功"
:1
echo "命令执行失败"
goto exit
pause

@echo off
if exist "C:\aaa.txt" del "C:\aaa.txt "

netsh interface ip show config,该命令显示当前系统的网络配置情况
重现安装TCP/IP协议。运行如下命令:netsh int ip reset c:\resetlog.txt

for /l %%i in (1,1,100) do ping 172.18.33.%%i -n 1 -w 1 >>c:/3.txt
pause

注册表:在windows系统中有一个记录了所有设备配置、用户配置信息和计算机运行的各种动态信息的中心数据库叫注册表。
作用:用来管理应用程序的安装、文件类型的关联、硬件设备的管理和用户的配置等信息。

注册表的来历
DOS:系统配置信息存放在config.sys和autoexec.bat两个文件中。
windows 3.0:系统配置信息越来越多,初始化文件越来越大,管理和修改困难。
Win.ini存放者Windows和Windows应用程序的配置。
SYS.ini负责存储系统硬件的配置信息。

注册表的结构:由根键、键、子键、键值等组成(注意:打开注册表的命令:regedit或者regedt32)
注册表根键以“HKEY-”来表示。
  (1)HKEY-CLASSES-ROOT定义已注册文件的扩展名、文件名、文件类型、文件图标等
  (2)HKEY-CURRENT-USER定义了当前用户的所有信息等。
  (3)HKEY-LOCAL-MACHINE定义了本地计算机软件、硬件的全部信息。
  (4)HKEY-USERS定义了计算机上所有用户的配置信息包括用户标示和密码列表。
  (5)HKEY-CURRENT-CONFIG默认情况下此处保存的是当前用户的配置文件的所有信息。

进入组策略:gpedit.msc
启动系统配置应用程序:msconfig










本文转自 周小玉 51CTO博客,原文链接:http://blog.51cto.com/maguangjie/1773447,如需转载请自行联系原作者
目录
相关文章
|
3月前
|
JavaScript Windows Python
Windows DOS进入指定盘符(磁盘路径)
Windows DOS进入指定盘符(磁盘路径)
56 1
|
4月前
|
关系型数据库 数据库连接 Windows
windows 常用的dos命令
windows 常用的dos命令
67 0
|
6月前
|
应用服务中间件 nginx Windows
windows下DOS命令杀掉Nginx应用进程
windows下DOS命令杀掉Nginx应用进程
|
5月前
|
Java 程序员 Windows
windows相关DOS命令简介与基操
windows相关DOS命令简介与基操
22 0
|
9月前
|
Windows
Windows DOS窗口查看历史执行过的命令的三种方式
Windows DOS窗口查看历史执行过的命令的三种方式
|
11月前
|
缓存 网络协议 Linux
Windows操作系统下的常用DOS命令
Windows操作系统下的常用DOS命令
233 0
|
11月前
|
Windows
WGCLOUD日常使用 - windows启动server,dos窗口显示乱码的问题处理
首先,这个乱码没有影响,忽略即可 这个是windows窗口编码导致的,不会影响程序运行,server/log下日志文件没有出现乱码,我们主要看日志文件
WGCLOUD日常使用 - windows启动server,dos窗口显示乱码的问题处理
|
12月前
|
C++ Windows
C++ 调用windows系统DOS命令的函数 system(char* command)
C++ 调用windows系统DOS命令的函数 system(char* command)
163 0
|
域名解析 缓存 网络协议
【TCP/IP】【调试】Windows常用网络相关DOS命令一览
【TCP/IP】【调试】Windows常用网络相关DOS命令一览
364 0
|
存储 Java 编译器
这是你必须掌握的 dos 命令 10分钟带你玩转windows小黑窗口!
我们使用计算机接触最频繁的就是DOS。DOS是英文Disk Operating System的缩写,意思是“磁盘操作系统”,顾名思义,DOS主要是一种面向磁盘的系统软件,说得简单些,DOS就是人给机器下达命令的集合,是存储在操作系统中的命令集,有了DOS,我们就可以更容易理解怎么给机器下命令。
这是你必须掌握的 dos 命令 10分钟带你玩转windows小黑窗口!

热门文章

最新文章