天天看点

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

goto 是流程控制转向命令

@echo on

type a.txt

echo 现在关闭命令显示!!!

goto last

dir

:last

dir a.txt

@echo off

set xxx="c:/"

echo 显示所有以字母x开头的变量....

set x

dir /w %xxx%

rem 删除名为xxx的变量

set xxx=

pause

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 正在测试是否可以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.

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文件及相关注册表文件....

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 根据文件的存在执行命令行

dir C:

if errorlevel 1 goto 1

if errorlevel 0 goto 0

:0

goto exit

echo "命令执行成功"

:1

echo "命令执行失败"

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

注册表:在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,如需转载请自行联系原作者