天天看點

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,如需轉載請自行聯系原作者