Capture service tag, assset tag of Dell systems and more

echo off
cls
:: by Juan Calderon 04/22
::
:: This needs to run as admin for bitlocker to report status.
::
:: Developed as an alternative over the snipping tool
::
:: This batch file will create an informative capture of a bitlocker status once complete encryption using cap.exe dos screen capture.

::find out what path the batch file is in
set batch_path=%~dp0

::change drive
%batch_path:~0,2%

::crop the last character and cd into it
cd %batch_path:~0,-1%

::we loop until bitlocker task is 100%

echo Waiting for Bitlocker Encrytion to be 100%
:loop
::repeat until find 100%
timeout 1 > nul
echo .
manage-bde c: -status | find “100%”
if errorlevel 1 goto loop
::bitlocker done

:: clear screen show bitlocker status
cls
manage-bde c: -status

:: display information on build
echo Enginner: %HomePath%
echo Machine name: %ComputerName%

::pipe machine service tag to serial.txt so that later we can reverse pipe into the variable that used to name the capture file
wmic bios get serialnumber | find /v “SerialNumber” > %temp%/serial.txt

::pipe in serial
set /p serial=<%temp%\serial.txt

:: trim spaces
set serial_temp=%serial: =%

:: store serial
set serial=%serial_temp%

::pipe machine asset tag to asset.txt so that later we can reverse pipe into the variable that used to name the capture file
wmic systemenclosure get SMBIOSAssetTag | find /v “SMBIOSAssetTag” > %temp%/asset.txt

::pipe in asset tag
set /p asset=<%temp%\asset.txt

:: trim spaces
set asset_temp=%asset: =%

:: store asset tag
set asset=%asset_temp%

:: display system info
echo Service Tag: %serial% – Asset Tag: – %asset%
echo Users directories present:
dir c:\Users\ /b
echo Capture taken on %date%

:: capture the screen, set to 1080p
cap “Bitlocker – Service Tag %serial% – Machine %ComputerName% – Asset Tag %asset%.jpg” 0 0 1920 1080

:: create an export of all software install, diagnostic
::echo Exporting software list to “Machine %ComputerName% – Service Tag %serial% – Asset Tag %asset%.txt”
::wmic product get name, version, vendor > “Machine %ComputerName% – Service Tag %serial% – Asset Tag %asset%.txt”

 

Posted on March 25, 2023, 11:28 am By
Categories: tech tips Tags: ,