# Windows Version and Configuration

## 1. System Information Commands

### 1.1 Basic System Information

**Command:**

```powershell
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
```

**Description:**\
Retrieves the operating system's name and version by filtering the output of the `systeminfo` command.

**Output:**\
Displays the OS name and version, allowing for quick identification of the running system.

### 1.2 Patch and Update Information

**Command:**

```powershell
wmic qfe listp
```

**Description:**\
Queries the system for installed Quick Fix Engineering (QFE) updates, showing details about each installed update.

**Output:**\
A list of installed updates, including update IDs, descriptions, and installation dates.

## 1.3 Architecture Information

**Command:**

```powershell
wmic os get osarchitecture
```

**Description:**\
Retrieves the operating system's architecture (e.g., 32-bit or 64-bit).

**Output:**\
Displays the OS architecture, which is essential for software compatibility.

***

## 2. Environment Variables

### 2.1 List Environment Variables

**Commands:**

```powershell
set
```

Or, using PowerShell:

```powershell
Get-ChildItem Env:
```

**Description:**\
Both commands display the current environment variables set on the system.

**Output:**\
Shows variable names and their values, providing insight into system configurations and environment settings.

***

## 3. Drive Information

### 3.1 List Logical Drives

**Command:**

```powershell
wmic logicaldisk get caption
```

**Description:**\
Lists the logical drives available on the system.

**Output:**\
Displays the drive letters (e.g., C:, D:) of all logical disks.

### 3.2 Detailed Drive Information

**Command:**

```powershell
wmic logicaldisk get caption, description, providername
```

**Description:**\
Provides detailed descriptions of each logical drive, including:

* **Caption:** Drive letter (e.g., C:)
* **Description:** Drive type (e.g., Local Disk)
* **Provider Name:** Network provider details (if applicable)

**Output:**\
Displays comprehensive information about the drives.

### 3.3 Using PowerShell to List Drives

**Command:**

```powershell
Get-PSDrive | Where-Object { $_.Provider -like "Microsoft.PowerShell.Core\FileSystem" } | Format-Table Key, Value
```

**Description:**\
Retrieves all drives available in PowerShell, filtering for filesystem drives, and formats the output as a table.

**Output:**\
Displays a structured table of drive keys and their corresponding paths.

***

## References

* **WMIC Documentation:** [Windows Management Instrumentation Command-line](https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic)
* **PowerShell Documentation:** [PowerShell Commands](https://learn.microsoft.com/en-us/powershell/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karim-ashraf.gitbook.io/karim_ashraf_space/writeups/windows-privilege-escalation/windows-version-and-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
