What is the difference between ProgramData and AppData?

To put it straight, ProgramData contains application data that is not user specific.This data will be available to all users on the computer. Any global data should be put in here. AppData folder contains configuration settings, downloaded information/files for a particular user. So, for example any user specific preferences and profile configurations can be stored … Read more

How can I detect if my process is running UAC-elevated or not?

For those of us working in C#, in the Windows SDK there is a “UACDemo” application as a part of the “Cross Technology Samples”. They find if the current user is an administrator using this method: private bool IsAdministrator { get { WindowsIdentity wi = WindowsIdentity.GetCurrent(); WindowsPrincipal wp = new WindowsPrincipal(wi); return wp.IsInRole(WindowsBuiltInRole.Administrator); } } … Read more

Get Screen resolution using WMI/powershell in Windows 7

For the record, the PowerShell code is: Get-WmiObject -Class Win32_DesktopMonitor | Select-Object ScreenWidth,ScreenHeight I get the same values in Landscape or in Portrait mode. UPDATE: In a multi monitor environment you can get the info for all monitors with: PS> Add-Type -AssemblyName System.Windows.Forms PS> [System.Windows.Forms.Screen]::AllScreens BitsPerPixel : 32 Bounds : {X=0,Y=0,Width=1280,Height=800} DeviceName : \\.\DISPLAY1 Primary … Read more

Visual Studio Code “Open With Code” does not appear after right-clicking a folder

Copied from Right click on Windows folder and open with Visual Studio Code Create file vsCodeOpenFolder.reg with this content (If you didn’t choose the default installation path then you need to adjust the paths in this file): Windows Registry Editor Version 5.00 ; Open files [HKEY_CLASSES_ROOT\*\shell\Open with VS Code] @=”Edit with VS Code” “Icon”=”C:\\Program Files … Read more