Skip to content

How to Get the Windows Registered Owner and Organization in Batch Script

Learn how to extract Windows Registered Owner and Organization details from the registry using a Batch script for inventory, audits, and asset tracking.

When a computer is first set up or imaged, Windows stores information about the "Registered Owner" and "Registered Organization". For many home users, these are assigned generic names like "User," but in corporate and institutional environments, they are often used to identify which department or specific employee a machine belongs to. Extracting this information via a Batch script is a simple way to add basic ownership data to specialized inventory logs or customized "About" screens.

This guide explains how to pull these details from the Windows Registry.

Why Identify the Registered Owner?

  • Asset Verification: Ensuring that a refurbished or second-hand machine has been correctly re-branded with your organization's name.
  • Reporting: Including the owner/org name in an automated system audit.
  • Troubleshooting: Identifying which "profile" or organizational unit originally commissioned the machine's installation.

Method 1: Using the Registry Query (Fastest)

Windows stores these strings in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

The two specific values are RegisteredOwner and RegisteredOrganization.

Basic Extraction Script

@echo off
setlocal

set "REG_PATH=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"

echo [PROCESS] Querying registration info...

:: Get the Owner
for /f "tokens=2*" %%a in ('reg query "%REG_PATH%" /v RegisteredOwner 2^>nul ^| find "RegisteredOwner"') do set "OWNER=%%b"

:: Get the Organization
for /f "tokens=2*" %%a in ('reg query "%REG_PATH%" /v RegisteredOrganization 2^>nul ^| find "RegisteredOrganization"') do set "ORG=%%b"

echo Registered Owner: %OWNER%
echo Registered Org:   %ORG%

pause

Method 2: Using the winver GUI (Manual only)

While not a Batch command for extracting data, running winver is the easiest way to manually verify this information.

@echo off
:: This just opens the "About Windows" window
winver

Creating an Inventory Log Script

A more professional use of this data is to save it to a central log file on a network share along with the computer's name.

@echo off
setlocal

:: Define the registry path
set "K=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"

:: 1. Extract data silently
for /f "tokens=2*" %%a in ('reg query "%K%" /v RegisteredOwner 2^>nul ^| find "RegisteredOwner"') do set "W_OWNER=%%b"
for /f "tokens=2*" %%a in ('reg query "%K%" /v RegisteredOrganization 2^>nul ^| find "RegisteredOrganization"') do set "W_ORG=%%b"

:: 2. Format the output
echo ------------------------------------------------------------
echo COMPUTER NAME: %COMPUTERNAME%
echo OWNER:         %W_OWNER%
echo ORGANIZATION:  %W_ORG%
echo ------------------------------------------------------------

:: 3. Export to file (Optional)
:: echo %COMPUTERNAME%, %W_OWNER%, %W_ORG% >> \\Server\Logs\OwnerAudit.csv

pause

Common Pitfalls and How to Avoid Them

Empty Values

On many modern Windows 10/11 Home installations, the "RegisteredOrganization" field is blank by default.

Wrong Way:

:: Assuming the variable is always filled
echo Processing for %W_ORG%...
:: If empty, this may display "Processing for ..." which looks broken in a UI.

Correct Way: Always include a fallback check for empty variables.

if "%W_ORG%"=="" set "W_ORG=No Organization Defined"

Parsing Token Issues

In the reg query command, the output contains several spaces between the value name and the data. If the owner's name has spaces (e.g., "John Doe"), a simple tokens=2 will only capture "John."

Best Practices for Data Privacy

  1. Be Transparent: If you are gathering this data for an audit, inform users so they know why their name is being collected.
  2. Combine with Login Info: Sometimes the "Registered Owner" is out-of-date. It is often more useful to compare this with the current logged-in user using the %USERNAME% variable.
  3. Use for Customization: You can use this information to create a dynamic Welcome message in your company's internal Batch tools.

Conclusion

Retrieving the Windows Registered Owner and Organization via Batch script is a quick and non-intrusive way to identify a system's assigned ownership. By leveraging simple registry queries, you can build smarter inventory tools and automate the documentation of your organization's hardware assets. This small detail adds a layer of professional context to your scripts, helping to ensure that every machine in your environment is accurately identified and correctly accounted for in your administration workflows.

Navigation