上午:

网络构成:

image-20210106085828233

image-20210106090007562

如我们之前配置的:

10.1.2.主机位

image-20210106090158872

image-20210106090505990

image-20210106090620804

image-20210106090910877

内部不需要网关!访问外部就需要网关了!

image-20210106091151976

image-20210106091444661

个人网络搭建:

桥接:虚拟机和主机同一ip网段!

NAT:同一ip

image-20210106094132790

win2003:

image-20210106094847998

win7:

image-20210106094924751

搭建完发现:子网掩码 现在不是特别严格!

image-20210106100400046

image-20210106100853716

image-20210106101512402

DOS命令

DOS 命令学习手册

基础::

image-20210106101646028

image-20210106102809781

image-20210106103701755

image-20210106110725999

image-20210106111550307

image-20210106113408893

帮助:

dir /?

image-20210106140718178

第一种:在桌面右击我的电脑–>管理,然后展开下面的服务和应用程序,双击服务。

第二种:命令方式,运win+R调出运行,在运行里输入“services.msc”后再回车。

第三种:直接可以双击C:\WINDOWS\system32目录下的services.msc同样可以调出计算机服务。

注意:计算机服务程序文件在那里不管是使用的是运行命令还是计算机管理中打开服务项,其实都是调用的C:\WINDOWS\system32目录下的services.msc程序文件

当然还有其他方式,如控制面板–>>管理工具里面

image-20210106153508327

netsh wlan show profiles              #查看所有连接过的无线网络名称
netsh wlan show profiles 无线名称 key =clear #查看无线网络名称 密码

自动查询wifi密码bat

for
/f “skip=10 tokens=1,2 delims=:” %i in (‘netsh wlan show profiles’) do
@for /f “tokens=1-2 delims=:” %k in (‘netsh wlan show profiles %j key ^=
clear ^|findstr /i “关键内容”‘) do @echo %%j,%%l>>
%USERPROFILE%\desktop\wifi.txt

@echo off
for
/f "skip=10 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do
@for /f "tokens=1-2 delims=:" %k in ('netsh wlan show profiles %j key ^=
clear ^|findstr /i "关键内容"') do @echo %%j,%%l>>
%USERPROFILE%\desktop\wifi.txt
pasue
@echo off
netsh wlan show profile name="SPWH_H32_87B994_5G" key=clear
netsh wlan show profile name="HUAWEI nova lite 3" key=clear

netsh wlan show profiles
pause

set /p wifi-name=pls input your wifi name :
netsh wlan show profile name="%wifi-name%" key=clear
pause>nul

批处理:

个人理解:就是把dos命令写到bat脚本里!和linux下shell脚本差不多!原理差不多!不是代码差不多!

批处理菜鸟教程

image-20210106142346741

image-20210106142439229

image-20210106143229181

image-20210106144259108

>null 2 >null不会报错! 错了也不报错!
ping -n 10 127.0.0.1 >nul 2>nul 就和pasue一样

清理系统垃圾:

@echo off

echo 正在清除系统垃圾文件,请稍等......

del /f /s /q %systemdrive%\*.tmp #%systemdrive%就是 c:

del /f /s /q %systemdrive%\*._mp

del /f /s /q %systemdrive%\*.log

del /f /s /q %systemdrive%\*.gid

del /f /s /q %systemdrive%\*.chk

del /f /s /q %systemdrive%\*.old

del /f /s /q %systemdrive%\recycled\*.*

del /f /s /q %windir%\*.bak

del /f /s /q %windir%\prefetch\*.* #%windir% 是 C:\WINDOWS 直接用echo %windir%查看!

rd /s /q %windir%\temp & md %windir%\temp

del /f /q %userprofile%\cookies\*.* # %userprofile%是 C:\Users\lenovo 为什么这样写呢!个人通过学习感觉是直接调用了环境变量!!是不是很像!好像就是环境变量!

del /f /q %userprofile%\recent\*.*

del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"

del /f /s /q "%userprofile%\Local Settings\Temp\*.*"

del /f /s /q "%userprofile%\recent\*.*"

echo 清除系统LJ完成!

echo. & pause #&-它的作用是用来连接n个DOS命令,并把这些命令按顺序执行,而不管是否有命令执行失败;

image-20210106162942921

@echo off
:1
echo "hello wellcome to code 1"
pause
goto 3

:2
echo "hello wellcome to code 2"
pause
goto 4

:3
echo "hello wellcome to code 3"
pause
goto 2

:4
echo "hello wellcome to code 4"
pause

image-20210106164009886

ntsd -c q -pn winlogon.exe   #winxp 和win2003可用,蓝屏
taskkill /im explorer.exe /f #杀死一个桌面 恢复start explorer.exe

练习goto和start和杀死一个桌面

@echo off
rem gogogo #dadada
:1 #dad
echo "hello wellcome to code 1"

start C:\Users\lenovo\Desktop\Xiaoma >nul 2>nul


goto 3


:2
echo "hello wellcome to code 2"
start explorer.exe

goto 4

:3
echo "hello wellcome to code 3"
taskkill /im explorer.exe /f

goto 2

:4
echo "hello wellcome to code 4"
goto 1

image-20210106170833460

image-20210106171641039

坏坏的!

win7和win10 shell:startup 开机自动启动!

win2003:

image-20210106172408657

win还有定时任务!

Win7设置定时自动执行程序或脚本