Windows Environment Commands

Windows Environment Commands

These are my most frequently used, often to just get to a location on the SystemRoot quickly. None of these are case sensistive

%USERPROFILE% - Equivalent of ~ on *nix systems.
%WINDIR% - Windows Directory although it seems to hav ebeen superseded by %SystemRoot%
%APPDATA% - Goes to the roaming folder
%LOCALAPPDATA% - goes to the local folder
%LOGONSERVER% -  goes to \\domain_logon_server
%PROGRAMFILES% - C:\Program Files
%PROGRAMFILES(X86)% - C:\Program Files (x86)
%PSModulePath% - Powershell Modules Path

Create a List of installed Software

This time using powershell a list of software can be output to OUT-GridView

Particularly useful to just check remotely or silently using a remote command line. Several ways to output this

1.To WMI Gridview

Get-WmiObject -Class Win32_Product | Select-Object -Property Name, Vendor, InstallDate, Language, Version | Out-GridView

2. To the Screen

Get-WmiObject -Class Win32_Product | Select-Object -Property Name, Vendor, InstallDate, Language, Version

3. To a Text file

Get-WmiObject -Class Win32_Product | Select-Object -Property Name, Vendor, InstallDate, Language, Version 
| Out-File result.txt