@echo off color 0a title Hardware Viewer mode con cols=90 echo Hardware Viewing..... sc config winmgmt start= auto >nul 2<&1 net start winmgmt 2>nul setlocal ENABLEDELAYEDEXPANSION del /f "%TEMP%\temp.txt" 2>nul dxdiag /t %TEMP%\temp.txt del /f "%COMPUTERNAME%.txt" 2>nul echo System Information: >>%COMPUTERNAME%.txt :system rem This must 30s if EXIST "%TEMP%\temp.txt" ( for /f "tokens=1,2,* delims=:" %%a in (‘findstr /c:" Machine name:" /c:" Processor:" /c:" System Model:" /c:" Memory:" /c:" Card name:" /c:"Display Memory:" /c:"Current Mode:" "%TEMP%\temp.txt"‘) do ( set /a tee+=1 if !tee! == 1 echo Computer Name: %%b>>%COMPUTERNAME%.txt if !tee! == 2 echo System Model: %%b>>%COMPUTERNAME%.txt if !tee! == 3 echo CPU Model: %%b>>%COMPUTERNAME%.txt if !tee! == 4 echo RAM Size: %%b>>%COMPUTERNAME%.txt if !tee! == 5 echo. >>%COMPUTERNAME%.txt if !tee! == 5 echo DisplayCard: >>%COMPUTERNAME%.txt if !tee! == 5 echo Display Card: %%b>>%COMPUTERNAME%.txt if !tee! == 6 echo DisplayMemory: %%b>>%COMPUTERNAME%.txt ) ) else ( ping /n 2 127.1>nul goto system ) set tee=0 echo.>>%COMPUTERNAME%.txt echo Mother Board:>>%COMPUTERNAME%.txt for /f "tokens=1,* delims==" %%a in (‘wmic BASEBOARD get Manufacturer^,Product^,Version^,SerialNumber /value‘) do ( set /a tee+=1 if "!tee!" == "3" echo Manufacturer : %%b>>%COMPUTERNAME%.txt if "!tee!" == "4" echo MotherBoard Model : %%b>>%COMPUTERNAME%.txt ) set tee=0 ) set tee=0 echo. >>%COMPUTERNAME%.txt echo Hard Disk: >>%COMPUTERNAME%.txt for /f "tokens=1,* delims==" %%a in (‘wmic DISKDRIVE get model^,interfacetype^,size^,totalsectors^,partitions /value‘) do ( set /a tee+=1 if "!tee!" == "3" echo Interface Class : %%b>>%COMPUTERNAME%.txt if "!tee!" == "4" echo Harddisk Model : %%b>>%COMPUTERNAME%.txt if "!tee!" == "5" echo PartionNum : %%b>>%COMPUTERNAME%.txt if "!tee!" == "6" echo Size : %%b>>%COMPUTERNAME%.txt ) rem echo Partion Information: rem wmic LOGICALDISK where mediatype=‘12‘ get description,deviceid,filesystem,size,freespace set tee=0 echo. >>%COMPUTERNAME%.txt echo NetCard:>>%COMPUTERNAME%.txt for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "Description"‘) do ( set name=%%a echo NetCard Model: %%a>>%COMPUTERNAME%.txt ) for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "Physical Address"‘) do ( set name=%%a echo MAC Address: %%a>>%COMPUTERNAME%.txt ) for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "描述"‘) do ( set name=%%a echo NetCard Model: %%a>>%COMPUTERNAME%.txt ) for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "物理地址"‘) do ( set name=%%a echo MAC Address: %%a>>%COMPUTERNAME%.txt ) ver|find /i "windows xp">nul 2>nul&&goto xp||goto win7 :xp for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "IP Address"‘) do ( set name=%%a echo IP Address: %%a>>%COMPUTERNAME%.txt ) :win7 for /f "tokens=2* delims==:" %%a in (‘ipconfig/all^|find /i "IPV4"‘) do ( set name=%%a echo IP Address: %%a>>%COMPUTERNAME%.txt ) echo View Over! net use \\172.17.44.103 password /user:user copy %COMPUTERNAME%.txt \\192.168.1.1\HardFile$pause start %COMPUTERNAME%.txt
只需要将倒数4-5行修改成自己的文件服务器信息即可.
时间: 2024-11-04 02:05:52