Posts

Showing posts with the label windows

How to find PID of Windows Service

sc queryex < servicename >

Run 32bit .Net application with >2GB RAM on 64bit machine

To allow your 32bit application use more than 2GB of RAM you need to modify the *.exe file with editbin utility. (open ‘Visual Studio Command Prompt’ and it will be on the path) editbin /LARGEADDRESSAWARE <your-app.exe> or just add these 2 lines to your Post-build event in Visual Studio call "$(DevEnvDir)..\tools\vsvars32.bat" editbin /LARGEADDRESSAWARE "$(TargetPath)" or these if you are building your project with msbuild outside of Visual Studio call "%VS100COMNTOOLS%\vsvars32.bat" editbin /LARGEADDRESSAWARE "$(TargetPath)" To check if all ok run dumpbin utility as below and check if the output has ‘Application can handle large (>2GB) addresses’ text in FILE HEADER VALUES. dumpbin /headers <your-app.exe>

Remote Desktop Connection Manager

Remote Desktop Connection Manager “RDCMan manages multiple remote desktop connections. It is useful for managing server labs or large server farms where you need regular access to each machine such as automated checkin systems and data centers. It is similar to the built-in MMC Remote Desktops snap-in, but more flexible.”

C# Addin framework, MEF Example (Managed Extensibility Framework)

Image
Example of using MEF to dynamically load calculator object. Create .Net 4.0 solution with the following projects (MEFExample is Console others are Libraries) Add Reference to System.ComponentModel.Composition to Library projects. public interface ICalculator { string Name { get ; } int Calculate( int a, int b); } public class CalculatorManager { [ImportMany( typeof (ICalculator))] private IEnumerable<ICalculator> _calculators; public IEnumerable<ICalculator> GetCalculators() { var catalog = new AggregateCatalog(); catalog.Catalogs.Add( new DirectoryCatalog(@" .\extensions\ ")); var container = new CompositionContainer(catalog); container.ComposeParts( this ); Console.WriteLine(" Found {0} Calculators ", _calculators.Count()); return _calculators; } } [Export( typeof (ICalculator))] public class CalculatorAdd : ICalculator { publi...

Save window size & position in WPF

* Right Click on Settings.settings and Open With XML (Text) Editor * Add Top, Left, Height, Width & WindowState settings < Settings > < Setting Name = "Top" Type = "System.Double" Scope = "User" > < Value Profile = "(Default)" > 50 </ Value > </ Setting > < Setting Name = "Left" Type = "System.Double" Scope = "User" > < Value Profile = "(Default)" > 50 </ Value > </ Setting > < Setting Name = "Height" Type = "System.Double" Scope = "User" > < Value Profile = "(Default)" > 800 </ Value > </ Setting > < Setting Name = "Width" Type = "System.Double" Scope = "User" > < Value Profile = "(Default)" > 1200 </ Value > </ Setting > < Setting Name = "WindowSta...

How to set Microsoft IIS to 32bit on 64bit server

go to %systemdrive%\Inetpub\AdminScripts run cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 1 go to  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 run IIS installer aspnet_regiis.exe -i Allow 'ASP.NET v2.0.50727 (32-bit)' under Internet Information Services/Web Service Extensions Disable 'ASP.NET v2.0' if exists (this is 64bit version) Restart IIS

Active Directory Lookup Window

%windir%\system32\rundll32.exe dsquery.dll,OpenQueryWindow

Windows user group permissions

net user <username> / domain

Open command line from context menu

This is the x64 version of Open Command Windows Here from PowerToys for Windows XP Create .reg file with this script and execute it. Windows Registry Editor Version 5 . 00 [HKEY_LOCAL_MACHINE \S OFTWARE\Classes\Folder \s hell\Command Prompt] @="Open Command Window Here" [HKEY_LOCAL_MACHINE \S OFTWARE\Classes\Folder \s hell\Command Prompt\command] @="Cmd . exe /k pushd %L"

Add, remove, update, query Windows Services from command line

Windows ‘sc’ command can be used to manipulate Windows Services. More info can be found on Microsoft TechNet

Windows Remote Desktop on multiple screens

To get the multiple screen support on Windows XP download the latest (6.0 or above) ' Remote Desktop Connection ' software from Microsoft website. And run the following command mstsc /span /v:"pc-name" Here you can find more info about mstsc command

Open command line window in windows XP from the context menu

This is a very useful tool for Windows XP that enables to you open command line window from context menu. Just right click on any folder and select Open Command Window Here . You can download it from the PowerToys Windows XP page. This works only for x86 system, to add context menu item to x64 machine follow these steps .