powershell : changing the culture of current session

Have a look here: http://blogs.msdn.com/b/powershell/archive/2006/04/25/583235.aspx and here: http://poshcode.org/2226: function Set-Culture([System.Globalization.CultureInfo] $culture) { [System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture [System.Threading.Thread]::CurrentThread.CurrentCulture = $culture } Additional Info To find which values can be used for $culture: This will give you a list of Culture Types: [Enum]::GetValues([System.Globalization.CultureTypes]) Selecting one of the above types (e.g. AllCultures) you can then list the available values … Read more

How do I retrieve the version of a file from a batch file on Windows Vista?

and three ways without external tools 1.WMIC WMIC DATAFILE WHERE name=”C:\\install.exe” get Version /format:Textvaluelist Pay attention to the double slashes of file name. Ready to use script: @echo off :wmicVersion pathToBinary [variableToSaveTo] setlocal set “item=%~1” set “item=%item:\=\\%” for /f “usebackq delims=” %%a in (`”WMIC DATAFILE WHERE name=”%item%” get Version /format:Textvaluelist”`) do ( for /f “delims=” … 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