批处理获取当前计算机名、工作站域、IP输出文件,并根据文件修改系统信息
两个批处理文件,一个用于装系统之前,获取当前计算机名、计算机描述、工作组、IP,并保存记录到E:\SYSINFO.LOG一个用于装系统之后,根据E:\SYSINFO.LO...
两个批处理文件,一个用于装系统之前,获取当前计算机名、计算机描述、工作组、IP,并保存记录到E:\SYSINFO.LOG
一个用于装系统之后,根据E:\SYSINFO.LOG里的信息对系统的计算机名、计算机描述、工作组、IP进行修改
wmic那两行貌似有问题,提示无效名称指定的参数列表,IP已经搞定,还有计算机描述没成功,SRVCOMMENT会提示Y/N,这个有点不懂,不知道是要Y还是要N,反正需要一键搞定
@echo
set fn=e:\sysinfo.log
for /f "tokens=1* delims= " %%i in ('findstr 计算机名 %fn%') do set n=%
%j
for /f "tokens=1* delims= " %%i in ('findstr 计算机描述 %fn%') do set
d=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工作组 %fn%') do set g=%%j
for /f "tokens=1* delims= " %%i in ('findstr IP地址 %fn%') do set ip=%%j
wmic computersystem where Name="%computername%" call rename name=%n%
wmic computersystem where Name="%computername%" call
Joindomainorworkgroup name=%g%
pause
netsh interface ip set address name="本地连接" source=static addr=%ip%
mask=255.255.255.0
pause
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\Parameters" /v srvcomment /t reg_sz /d %d% /f
net config server /SRVCOMMENT:"%d%" 展开
一个用于装系统之后,根据E:\SYSINFO.LOG里的信息对系统的计算机名、计算机描述、工作组、IP进行修改
wmic那两行貌似有问题,提示无效名称指定的参数列表,IP已经搞定,还有计算机描述没成功,SRVCOMMENT会提示Y/N,这个有点不懂,不知道是要Y还是要N,反正需要一键搞定
@echo
set fn=e:\sysinfo.log
for /f "tokens=1* delims= " %%i in ('findstr 计算机名 %fn%') do set n=%
%j
for /f "tokens=1* delims= " %%i in ('findstr 计算机描述 %fn%') do set
d=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工作组 %fn%') do set g=%%j
for /f "tokens=1* delims= " %%i in ('findstr IP地址 %fn%') do set ip=%%j
wmic computersystem where Name="%computername%" call rename name=%n%
wmic computersystem where Name="%computername%" call
Joindomainorworkgroup name=%g%
pause
netsh interface ip set address name="本地连接" source=static addr=%ip%
mask=255.255.255.0
pause
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\Parameters" /v srvcomment /t reg_sz /d %d% /f
net config server /SRVCOMMENT:"%d%" 展开
1个回答
展开全部
有事,第二个没来的及写完,先试试,不行追问找时间再完善
@echo off
set fn=r:\sysinfo.log
echo 计算机名=%computername%>%fn%
for /f "tokens=2* skip=3" %%i in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\Parameters" /v srvcomment') do echo 计算机描述=%%j>>%fn%
for /f "skip=1" %%i in ('wmic computersystem where Name^="%COMPUTERNAME%" get domain') do echo 工作组=%%i>>%fn%
for /f "tokens=2 delims=:" %%i in ('ipconfig^|findstr "IP Address"') do echo IP地址=%%i>>%fn%
@echo off
set fn=r:\sysinfo.log
for /f "tokens=1* delims= " %%i in ('findstr 计算机名 %fn%') do set n=%%j
for /f "tokens=1* delims= " %%i in ('findstr 计算机描述 %fn%') do set d=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工作组 %fn%') do set g=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工IP地址 %fn%') do set ip=%%j
wmic computersystem where Name="%computername%" call rename name=%n%
wmic computersystem where Name="%computername%" call Joindomainorworkgroup name=%g%
@echo off
set fn=r:\sysinfo.log
echo 计算机名=%computername%>%fn%
for /f "tokens=2* skip=3" %%i in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\Parameters" /v srvcomment') do echo 计算机描述=%%j>>%fn%
for /f "skip=1" %%i in ('wmic computersystem where Name^="%COMPUTERNAME%" get domain') do echo 工作组=%%i>>%fn%
for /f "tokens=2 delims=:" %%i in ('ipconfig^|findstr "IP Address"') do echo IP地址=%%i>>%fn%
@echo off
set fn=r:\sysinfo.log
for /f "tokens=1* delims= " %%i in ('findstr 计算机名 %fn%') do set n=%%j
for /f "tokens=1* delims= " %%i in ('findstr 计算机描述 %fn%') do set d=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工作组 %fn%') do set g=%%j
for /f "tokens=1* delims= " %%i in ('findstr 工IP地址 %fn%') do set ip=%%j
wmic computersystem where Name="%computername%" call rename name=%n%
wmic computersystem where Name="%computername%" call Joindomainorworkgroup name=%g%
快又稳
2024-10-28 广告
2024-10-28 广告
在Linux环境下配置基于域名的虚拟主机,需安装Apache或Nginx等Web服务器,并编辑配置文件。以Apache为例,需创建虚拟主机配置文件,指定域名、文档根目录等,然后启用该配置文件并重启Apache服务。同样,Nginx也需在相应...
点击进入详情页
本回答由快又稳提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询