• 0

Batch file to take inventory of computers on the network

  • 0


how do i create a batch file that will scan the network and print out the The types of systems on the network, mac address, IP address, computer make and model, computer name and the last person that logged into them?

This is what I have so far but its not working and I dont understand, what is missing..

for /f “tokens=2*” %%a in (‘net user “%Username%” /domain ^| find /i “Full Name”‘) do set DisplayName=%%b
echo Your display name is “%DisplayName%”

REM **** Take Inventory ****
CD c:
echo User Name: %DisplayName% (%username%) > “C:%DisplayName%.txt”
echo Computer: %computername% >> “C:%DisplayName%.txt”
echo Date: %date% Time: %time% ^ >> “C:%DisplayName%.txt”
echo. >> “C:%DisplayName%.txt”

wmic csproduct get name | more >> “C:%DisplayName%.txt”
wmic bios get serialnumber | more >> “C:%DisplayName%.txt”



1 Answer

  1. The only thing I see so far is:
    CD C:
    on my w-7, CD must have the /d: switch in order to switch drives: CD C: does not work, but CD /D C: does. Or, you could use PUSHD without the /d switch. In future posts, you might note where the batch is failing, to help locating the offending code.

    • 0