当前位置:DOS资源站资料中心批处理教程 → 批处理常用应用方法

批处理常用应用方法

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-24 20:30:54

@echo off&title DOS资源站 www.cmdos.net

color 0a
title 正在更换桌面 ...
echo 正在添加注册表项目...
set regadd=reg add "HKEY_CURRENT_USER\Control Panel\Desktop
%regadd%" /v TileWallpaper /d "0" /f
%regadd%" /v Wallpaper /d "\\192.168.0.2\setup\Desktop.bmp" /f
%regadd%" /v WallpaperStyle /d "2" /f
echo 正在更换桌面背景
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters

-------------------修改主页
@reg delete "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
@reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /d "http://192.168.0.251/1/index.asp"; /f

--------------------开启服务(要举一反三哦)
@echo off
net start "remote registry"

-------------------修改网关,DNS(记得开远程注册表服务,有人不会开,上面一个就是。)
@echo off
netsh interface ip set address name="本地连接" source=static gateway=192.168.0.1 gwmetric=1
netsh interface ip set dns name="本地连接" source=static addr=202.101.114.55
netsh interface ip add dns name="本地连接" addr=202.101.98.55 index=2

-----------------绑定网关
@echo off
arp -d
arp -s 192.168.0.1 00-e0-4c-10-6c-19

@echo off
-------------------绑定本机IP与MAC
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M
if exist IPAddr.txt del IPaddr.txt
find "IP Address" ipconfig.txt >IPAddr.txt
for /f "skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I
arp -s %IP% %Mac%
del ipaddr.txt
del ipconfig.txt
del phyaddr.txt

----------------安装ie插件9.0
@echo off

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 \\192.168.0.2\setup\flash9\swflash.inf
regsvr32 /s "%systemroot%\system32\Macromed\Flash\Flash9.ocx"

exit

复制存为bat文件即可  其中,ie插件先到网上下载最新的后,解压至到共享目录,如\\192.168.0.2\(共享的机子ip)setup(共享文件夹)根据实际情况修改