PsInfo - CMD


Overview

PsInfo is a command-line tool for Windows that gathers detailed information about system hardware and operating systems. It is part of the Sysinternals Suite and is primarily used for viewing system information remotely or on the local machine. This tool is especially useful in environments where centralized IT management or inventory is required, as it can help administrators keep track of various system details across multiple machines.

Syntax

The basic syntax for using PsInfo is as follows:

PsInfo [-d] [-h] [-s] [-c [-t delimiter]] [\\computer[-u user [-p psswd]]] [-accepteula]
  • \\computer specifies the remote computer to connect to. If omitted, information about the local computer is shown.

Options/Flags

  • -d: Shows disk volume information.
  • -h: Show installed hotfixes.
  • -s: Lists installed software.
  • -c: Formats the output as CSV (Comma-Separated Values). Useful for importing into spreadsheets.
  • -t delimiter: Specifies a delimiter for the CSV output. Common delimiters include commas (,), semicolons (;), or pipes (|).
  • \computer: Specifies the target remote computer. Defaults to the local system if not specified.
  • -u user: Specifies the username to use when connecting to the remote system.
  • -p psswd: Specifies the password for the given username. If omitted, PsInfo prompts for it.
  • -accepteula: Automatically accept the End-User License Agreement. Useful for scripts that automate the command.

Examples

  1. View basic system information of the local computer:
    PsInfo
    
  2. Display detailed system and disk information for a remote system:
    PsInfo -d \\\\REMOTE_PC
    
  3. List all installed software on a remote machine with CSV output:
    PsInfo -s -c -t , \\\\REMOTE_PC
    
  4. Show hotfixes installed on the local machine:
    PsInfo -h
    

Common Issues

  • Access Denied: This occurs when the user does not have sufficient permissions on the target remote machine. Ensure you have administrative rights or use the -u and -p options to specify credentials with sufficient rights.
  • Network issues: If the remote machine is not accessible, ensure that there are no network connectivity issues or firewall configurations blocking access.

Integration

Combine PsInfo with other CMD commands or PowerShell scripts for advanced system monitoring and reporting. For example:

@echo off
for /f "tokens=*" %%i in (servers.txt) do (
    PsInfo -d -h -s \\%%i >> systems_report.txt
)

This script reads a list of server names from servers.txt, queries their system information using PsInfo, and appends it to a systems_report.txt file.

  • PsTools: Other tools in the PsTools suite such as PsExec, PsList, PsKill, which can be used for various system management tasks.
  • SystemInfo: A built-in Windows command that also displays system information, though less detailed compared to PsInfo.

For more detailed information, refer to the Sysinternals PsInfo page.