重置网络设置有时候Windows不知道发生了啥情况,网络无法使用,就连重新启动大法都不管用了,这时候可以尝试重置网络设置
netsh winsock reset重置输入法输入法有时候也不知道藏哪去了,打字也不出来,重置一下吧 。
ctfmon批量安装就像之前说的,因为域账号没有安装软件的权限,所以需要切换的本地的.\administrator账号的身份去安装,但是每一个安装程序安装都要输入一次账号密码 。
我写了个小脚本来实现,对当前目录(即可bat所在或者执行所在目录)下的常见可执行程序后缀进行安装打开 。只需要第一次切换为administrator账号,后面的软件包都会使用administrator权限进行安装 。
for %%f in (*.msu,*.msi,*.exe) do ( start /wait %%f )设置hostname设置主机名,方便DHCP和DNS服务器管理
netdom.exe renamecomputer %COMPUTERNAME% /newname:域地址源代码@echo offecho %~0 by alittlemc;version 1.0;updatetime 2022-10-04 午echo hostname %COMPUTERNAME%;user %USERNAME%:start0echo ----------====start====----------echo ID NOTESecho 00 退出echo 0 切换到administrator执行echo 0a 切换到指定用户执行echo 1 重置网络设置echo 2 修复输入法echo 3 清空回收站echo 4 批量安装%~dp0目录下全部*.msu,*.msi,*.exe可执行文件echo 5 重命计算机名字echo 6 新电脑设置域echo 6a 老电脑修改域echo.set dev=设备管理器(devmgmt.msc)set reg=注册表(regedit)set dco=系统组件(dcomcnfg)set com=计算机管理(compmgmt.msc)set mst=远程桌面(mstsc)set cle=磁盘清理(cleanmgr)set lus=本机用户/组(lusrmgr.msc)set osk=屏幕键盘(osk)set info=显示系统信息set win=检查Windows系统(winver)set fsm=共享文件夹管理(fsmgmt.msc)set gpe=组策略(gpedit.msc)set uti=辅助功能(utilman)set off=注销(logoff)echo =其他=echo 01 %dev%echo 02 %reg%echo 03 %dco%echo 04 %com%echo 05 %mst%echo 06 %cle%echo 07 %lus%echo 08 %osk%echo 09 %win%echo 10 %fsm%echo 11 %gpe%echo 12 %uti%echo off %off%echo info %info%::echo systemreset 重置Windows::echo systemreset-cleanpc 更新并重置Windowsecho.set /p sr=请输入需要的功能ID:goto %sr% 2>nul||echo 未匹配到的ID&%~0%&pause>nul:0 echo get administrator net user administrator /active:yes echo administratorgoto start:0a set /p user=输入用户名: echo change %user% net user %user% /active:yes echo %user%goto start:00 exitgoto start:1 echo 重置网络设置(netsh winsock reset) set y=<nul set /p y=确认重置网络?(y/n) if %y%==y (netsh winsock reset) set y=<nulgoto start:2 echo 修复输入法(ctfmon) ctfmongoto start:3 echo 清空回收站 set y=<nul set /p y=确认清空回收站?(y/n):if %y%==y (::清空Win7/Win8回收站for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a: (del /f /s /q "%%a:$recycle.bin*.*" >nul 2>nul))::清空XP回收站del /f /s /q "%systemdrive%ecycled*.*" >nul 2>nulecho 清空回收站完成!) else (echo no)set y=<nulgoto start:4 setlocal enabledelayedexpansion echo 批量安装 set y=<nul set /p "y=安装当前目录中可执行程序?(y/n)" for %%f in (*.msu,*.msi,*.exe) do ( start /wait %%f )::子目录也安装/R 默认安装/s set y=<nulgoto start:5 :rename set y=<nul echo 当前的主机名:%COMPUTERNAME% set /p id=请输入新主机名: set /p y=确认将%COMPUTERNAME%修改为%id%?(y/n/r) if %y%==r (goto rename) if %y%==y (netdom.exe renamecomputer %COMPUTERNAME% /newname: %id%) echo 当前的主机名:%COMPUTERNAME%goto start:6 :redomain set /p domain=请输入AD域名: set /p y=确认将域更新为%domain%?(y/n/r) if %y%==r (goto redomain) if %y%==y (netdom join %COMPUTERNAME% /DOMAIN:%domain%)::/UserD:%user%(用户帐号) /PasswordD:%passwd%(用户密码)goto start:info hostname wmic baseboard list brief wmic bios get serialnumber ::wmic nic get macaddress wmic cpu get caption, name, deviceid, numberofcores, maxclockspeed, status wmic memorychip get banklabel,devicelocator,capacity,speed wmic computersystem get totalphysicalmemory wmic computersystem get caption,dnshostname,model,systemtype wmic nic list brief wmic diskdrive get model,size wmic logicaldisk get name,size :wmic partition get name,size,type wmic ntdomain get caption,dnsforestname,domaincontrolleraddress,domaincontrollername,statusgoto start::其他:01echo %dev%devmgmt.mscgoto start:02echo %reg%regeditgoto start:03echo %dco%dcomcnfggoto start:04echo %com%compmgmt.mscgoto start:05echo %mst%mstscgoto start:06echo %cle%fsmgmt.mscgoto start:07echo %lus%lusrmgr.mscgoto start:08echo %osk%oskgoto start:09echo %win%winvergoto start:10echo %fsm%fsmgmt.mscgoto start:11echo %gpe%gpedit.mscgoto start:12echo %uti%utilmangoto start:off set y=<nul set /p y=确认注销?(y/n): if %y%==y (logoff) set y=<nulgoto start:startecho -----------====end====-----------echo.goto start0pause>nul
经验总结扩展阅读
- 昆明哪几所高中好一些
- 肛门囊肿是什么
- 美的空调pk格力空调 两者哪个更好一些
- 得了慢性胃炎会瘦吗
- 中 ?打造企业自己代码规范IDEA插件
- 求一些类似遮天的玄幻小说
- 「Tubian」Tubian0.41!支持Windows QQ微信!
- frp服务利用云主机实现Windows远程连接
- frp服务利用云主机docker服务实现Windows远程连接
- 暖宫能减肥吗