Showing posts with label OS. Show all posts
Showing posts with label OS. Show all posts

May 08, 2011

How to change the Volume Licensing product key on a computer that is running Windows XP Service Pack 1 and later versions of Windows XP

http://support.microsoft.com/default.aspx?scid=kb;en-us;328874

October 22, 2008

Debugging Windows Handles (COM+ crash)

This post explains how to debug COM+ crashing issues using windows debugging tools.

Problem:

The main problem is that the COM+ applications are crashing and reporting event log entries that access violations have occurred. The access violations that are occurring within your “MyCOM” COM+ application is crashing the entire COM+ application and will get restarted on the next activation request.

What I would like to do is to enable PageHeap for this “MyCOM” COM+ application and then configure DebugDiag again to monitor for additional Access Violation exceptions for this process. Here are the precise steps to troubleshoot further.

Action

I’m not sure how many COM+ applications you have running on the machine. When we enable pageheap we have to do it based on process name so ALL dllhost.exe processes would have pageheap enabled. If you only have one or two COM+ applications then it won’t be much of a problem. If you have multiple COM+ applications then you’ll see a memory performance impact on the machine as more memory will be required by each instance of dllhost.exe running on the machine. I’ll assume that you have a lot of COM+ apps so to workaround this we can isolate the “MyCOM” to its own custom COM+ application process using the steps below.

1. Download the Windows Debugging Tools onto the APP server. You can download these tools onto a workstation and just copy the installation directory over to the APP machine if you prefer. We recommend during installation select the directory C:\Debuggers for the location to install these tools. http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a  (Current release 6.11.1.404 will be fine)

2. On the APP server navigate to C:\Windows\System32 directory. Find the executable ‘dllhost.exe’. Right click on the file -> select Copy -> then in file explorer go to Edit -> Paste copy. Then rename the copy to ‘mydllhost.exe’. This step effectively just creates a copy of the surrogate process, dllhost.exe, but we isolate and rename this copy to ‘mydllhost.exe’

3. Next let’s enable pageheap for the mydllhost.exe process. Open a command prompt and change directories to where you installed or copied the debugging tools (c:\debuggers). At the command prompt enable pageheap for the mydllhost.exe process by entering the following command:

gflags.exe /p /enable mydllhost.exe

4. Next we need to configure the “MyCOM” COM+ application to launch in ‘mydllhost.exe’ instead of the normal ‘dllhost.exe’ process.

a. Open up Component Services

b. Expand Computers -> My Computer -> COM+ Applications -> Right-click on the “MyCOM” COM+ application and select properties

c. When properties window opens click the “Advanced” tab

d. In the Debugging section on this tab click the checkbox for “Launch in debugger”. This enables the debugger path text box, in this text box remove the current string and replace it with the following string exactly. NOTE: I have already entered the correct process id GUID for your specific COM+ application which I was able to dig out of the crash dumps.

C:\WINDOWS\system32\mydllhost.exe /Processid:{A89A82B5-FE7C-4210-A79F-EBCE8811463C}

e. Then click the OK button to apply these settings change

5. At this point you just need to restart the “MyCOM” COM+ application. You can do this manually within component services, just right click on the COM+ app, select shutdown, then right-click again and select start

6. Open up Task Manager and confirm that you now have a new process called mydllhost.exe running. Since we enabled pageheap for this process name before restarting the COM+ app, pageheap is currently enabled for the mydllhost.exe that’s running

7. Now we just need to configure DebugDiag to monitor the mydllhost.exe process instances and create full user dumps when an access violation occurs

a. Open up DebugDiag 1.1

b. On the Rules tab click the “Add Rule…” button

c. Select Crash rule radio button and click Next

d. Select “A specific process” radio button and click Next

e. Find and select the mydllhost.exe process that’s in the process list. Make sure that the “This process instance only” check box is NOT selected, we need that cleared so that it re-attaches if the COM+ app recycles. Then click Next

f. Click the “Exceptions” button -> Click the “Add Exception…” button -> Click the C0000005 Access Violation exception in the list on the left -> On the right hand side here change the Action Type drop down to Full Userdump and change the action limit number value to 10. -> Click Ok -> Click Save and Close -> Click Next

g. Note the location where the userdumps will be written and then click Next

h. Select “Activate the rule now” radio button and click Finish

8. At this point, we’ve isolated your COM+ application to mydllhost.exe process, and we’ve enabled pageheap for that process. We also have DebugDiag attached and it will create full userdumps when any code violates any memory management problems which appears to be causing the memory corruption we see in the dumps already collected.

Lastly analyze the dump file to see actual problem.

Article:

Pushing the Limits of Windows: Handles

Video:

Understanding handle leaks and how to use !htrace to find them

May 12, 2008

How to get installed windows hotfix list?

1. If you run the below command this will create a HTM file in the root of c with all the hotfixes(a small install of WMI will be done automatically, I am noting this since this may require a CR to okay the installation)

wmic qfe list full /format:htable >C:\hotfixes.htm

2. Windows also stores all the HF information in the registry. If you export the this key to a txt file we can compare these as well

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix]

March 21, 2008

Windows Event Log Security

Windows 2003 server restricts logging in windows event log. Here are steps to enable logging for any application:

1. Open registry editor using "REGEDIT" command.

2. Traverse through following keys:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomSD

when you will click on "Application" at left pane you will see "CustomSD" and "Sources" in right pane as shown below. You have to changes values for "CustomSD" and "Sources".

clip_image001

3. First to update "CustomSD" - double click on "CustomSD" to get following edit window:

clip_image002

4. Copy "Value data" and save some where if we require it in the future. The copied value looks as below:

O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA)(A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)

5. Replace above value with following and click OK:

O:BAG:SYD:(A;;0x0002;;;AU)(A;;0xf0007;;;SY)(A;;0x7;;;BA)(A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)

6. Once you done with "CustomSD" double click on "Sources" in same window. You will get edit window as shown below. Scroll till the end and add "mriwebservices" and "wsMRIWeb" as shown below without quotation marks and then click OK.

clip_image003

Once you done with above steps you will see actual exception from web service in event log.

For more details see following KB article.

http://support.microsoft.com/default.aspx?scid=kb;en-us;323076#XSLTH3154121122120121120120

November 02, 2007

Powercfg Command-Line Options

You can use the Powercfg tool to control power settings and configure computers to default to Hibernate or Standby modes.

The Powercfg.exe tool is installed with Windows.

This MS-technet page has more info about command line options.

October 25, 2007

URLOpenBlockingStream() won't work with ISS compression.

In C++, URLOpenBlockingStream() method creates a blocking type stream object from a URL and downloads the data from the Internet.

We had issue where user was getting exceptions while using this method. Apparently it was happening due to ISS compression enabled on sever.

On a Windows 2003 Server (IIS 6 and compression are only available on this platform), you find the metabase.xml file. Right click on the file and click edit.

In the metabase.xml, you delete the asp file extension from the deflate and gzip compression sections (highlighted in red below)



<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/deflate"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="0"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="FALSE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"

>
</IIsCompressionScheme>
<IIsCompressionScheme Location ="/LM/W3SVC/Filters/Compression/gzip"
HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
HcCreateFlags="1"
HcDoDynamicCompression="TRUE"
HcDoOnDemandCompression="TRUE"
HcDoStaticCompression="TRUE"
HcDynamicCompressionLevel="0"
HcFileExtensions="htm
html
txt"

HcOnDemandCompLevel="10"
HcPriority="1"
HcScriptFileExtensions="exe

asp
dll"
>

May 12, 2007

Who Locked Me?

Have you ever bored by this Windows message : "Error Deleting File or Folder, ... There has been a sharing violation. The source or destination file may be in use.", when you try to delete, move or rename a file ?

WhoLockMe is a little extension for Windows Explorer. It permeets you to list all the process locking your selected file.

This is very helpful tool but....it won't work with Vista.

May 05, 2007

Install Windows XP on Your Pre-Installed Windows Vista

Because of my worst experience with Vista I decided to install XP on my machine. However hoping MS will do something good for Vista's issues I decided to have dual partition and keep Vista. However this task was not so simple as compared to my past experiences with dual operating systems. I had several issues including my disk type (SATA) while configuring dual boot system. If you have such plans then be prepared for worst and start...!

OK, my experience with XP? Awesome! It runs much-much faster than Vista and its worth to install XP on Vista.

Following are some excellent links from Geek guys to install XP on pre-loaded Vista.

April 25, 2007

My Experience with Vista

For last couple of days I am working on Windows Vista Business (T60 – Core2 Duo, T5500, 1GB RAM, and 64 MB Graphics Card) and I am very much disappointed with overall product as an Operating System.

As a normal computer user I prefer best performance over fancy graphics stuff. It’s OK to see fancy stuff for one or two times but then it’s irritating. Especially the animation when new window or pop-up box appears literally caused me headache - may be because of continuous iris and lens movement in my eyes.

Another annoying feature of Vista is User Account Control.


The main goal of User Account Control is to reduce the exposure and attack surface of the operating system by requiring that all users run in standard user mode. This limitation minimizes the ability for users to make changes that could destabilize their computers or inadvertently expose the network to viruses through undetected malware that has infected their computer.

The goal is fantastic but does that mean that I have to notify Vista each time to run the program? Does that mean improved security? Does Vista not able to handle this on its own without asking user each time permission to run the program? The best security is the security where user enters his credentials once (or none if it has ‘AI’ :)) and for the rest of session it takes care by all means. Funny thing is this was happening when I logged as an normal administrator and there are options in windows to disable these prompts…. Thank God (or thanks to Microsoft?) (Note there are two administrators in Vista - normal which usually we do and hidden super secrete administrator! The Super secrete administrator works fine w/o UAC problem and you can hack this account.)

The biggest disappointing thing about Vista is the performance! According to Vista Performance Information Tool my performance indicator for processor is 4.7 out 5, RAM-4.5/5, Hard Disk -4.9/5 and for Graphics 3.6 out of 5. I believe and experienced this as best configuration for Windows XP however on same configuration Vista runs like a nightmare. There are couples of articles available on Internet for the performance comparison between Vista and XP and all says XP is much better than Vista in almost all areas.

While experimenting with performance, one of the things which I observed was amount of paging was very high on my machine (may be because of 64MB graphics card and 1 GB of RAM). To improve performance I made couple of changes in my machine. As a normal practice with any new machine I disabled all unwanted services. I disabled couple of Vista features including side bar and fancy visual effects. With these changes my machine now looks as XP however still it is too far from XP in performance.

I also tried Windows ReadyBoost with 512 MB of USB flash but not seen any big improvement may be because of size and read/write speed. (Suggestions – Make sure you have minimum 512 MB of USB memory with enough Read/Write speed.)

Very frustrating thing about Vista is compatibility with other software products. I had this issue several times where software product runs fine on XP but causes issue on Vista. Good example is my Logitech Webcam – which works fine with XP but not on Vista. There are no drivers available from Logitech for my Webcam instead they are recommending to buy new Webcam for Vista! To solve this issue I installed Virtual Machine and then Windows XP but later I found that Virtual Machine doesn’t support USB port! I tried free VMware Player but it won’t work at all. However I have noticed that compare to host Vista, XP runs much better within Virtual Machine with only 400MB of RAM!! Another example about compatibility issue is my VPN connectivity client. I can’t use VPN client from Vista because of compatibility issue however good news is I have now XP on Virtual Machine and it works fine with VPN connection. I can’t use VPN connection from Vista until I get Vista compatible VPN client.

The most thundering thing about Vista compatibility is it won’t support Visual Studio 2003!

There are several rumors (since I don’t know exactly) on release of Vista's service pack but I am waiting desperately hoping some changes for performance and compatibility (I know it is daydream and will not happen in reality).

I have seen several people recommend preinstalled Visa if you have plans to buy a new machine. However I will recommend Vista unless and until you have plans to buy enough RAM (Min 2 GB) and better graphics card (256 MB or more). Most important make sure you will not have any compatibility issues with your existing software products. If you have XP installation CD then buy preinstalled Vista and then install XP in partition or install free Virtual Machine on Vista and then install XP to run Vista incompatible programs. However keep in mind Virtual Machine doesn’t support USB port.

Vista has introduced several new features and tools which are really useful but as a normal computer user (and not as a software professional) I am expecting high performance with better security instead of fancy graphics. You will enjoy fancy stuff for some time but then you will land on real problem!

March 15, 2007

Windows Vista Display Driver Model (and WPF)

Windows Display Driver Model (WDDM) is a new display driver architecture supported in Windows Vista. For the first time in Windows, graphics processing unit (GPU) multitasking is possible, enabling users to run more than one GPU-intensive application simultaneously. No doubt WPF will work better on Vista...

February 15, 2007

Cool feature in Windows Vista: Windows ReadyBoost

Windows Vista: Features Explained: Windows ReadyBoost: "Adding system memory (typically referred to as RAM) is often the best way to improve a PC's performance, since more memory means more applications are ready to run without accessing the hard drive. However, upgrading memory can be difficult and costly, and some machines have limited memory expansion capabilities, making it impossible to add RAM."

December 15, 2005

XP Run Commands (Win + R)

    • Accessibility Controls
      access.cpl

    • Add Hardware Wizard
      hdwwiz.cpl

    • Add/Remove Programs
      appwiz.cpl

    • Certificate Mgr
      certmgr.msc

    • Character Map
      charmap

    • Check Disk Utility
      chkdsk

    • Clipboard Viewer
      clipbrd

    • Command Prompt
      cmd

    • Component Services
      dcomcnfg

    • Computer Management
      compmgmt.msc

    • Date and Time Properties
      timedate.cpl

    • DDE Shares
      ddeshare

    • Device Manager
      devmgmt.msc

    • Direct X Control Panel (If Installed)
      directx.cpl

    • Direct X Troubleshooter
      dxdiag

    • Disk Cleanup Utility
      cleanmgr

    • Disk Defragment
      dfrg.msc

    • Disk Management
      diskmgmt.msc

    • Disk Partition Manager
      diskpart

    • Display Properties
      control desktop

    • Display Properties
      desk.cpl

    • Display Properties (w/Appearance Tab Preselected)
      control color

    • Dr. Watson System Troubleshooting Utility
      drwtsn32

    • Driver Verifier Utility
      verifier

    • Event Viewer
      eventvwr.msc

    • File Signature Verification Tool
      sigverif

    • Findfast
      findfast.cpl

    • Folders Properties
      control folders

    • Fonts
      control fonts

    • Fonts Folder
      fonts

    • Free Cell Card Game
      freecell

    • Game Controllers
      joy.cpl

    • Group Policy Editor (XP Prof)
      gpedit.msc

    • Hearts Card Game
      mshearts

    • Iexpress Wizard
      iexpress

    • Indexing Service
      ciadv.msc

    • Internet Properties
      inetcpl.cpl

    • IP Configuration (Display Connection Configuration)
      ipconfig /all

    • IP Configuration (Display DNS Cache Contents)
      ipconfig /displaydns

    • IP Configuration (Delete DNS Cache Contents)
      ipconfig /flushdns

    • IP Configuration (Release All Connections)
      ipconfig /release

    • IP Configuration (Renew All Connections)
      ipconfig /renew

    • IP Configuration (Refreshes DHCP & Re-Registers DNS)
      ipconfig /registerdns

    • IP Configuration (Display DHCP Class ID)
      ipconfig /showclassid

    • IP Configuration (Modifies DHCP Class ID)
      ipconfig /setclassid

    • Java Control Panel (If Installed)
      javaws

    • Keyboard Properties
      control keyboard

    • Local Security Settings
      secpol.msc

    • Local Users and Groups
      lusrmgr.msc

    • Logs You Out Of Windows
      logoff

    • Microsoft Chat
      winchat

    • Minesweeper Game
      winmine

    • Mouse Properties
      control mouse

    • Mouse Properties
      main.cpl

    • Netstat
      netstat

    • Network Connections
      control netconnections

    • Network Connections
      ncpa.cpl

    • Network Setup Wizard
      netsetup.cpl

    • Notepad
      notepad

    • Nview Desktop Manager (If Installed)
      nvtuicpl.cpl

    • Object Packager
      packager

    • ODBC Data Source Administrator
      odbccp32.cpl

    • On Screen Keyboard
      osk

    • Opens AC3 Filter (If Installed)
      ac3filter.cpl

    • Password Properties
      password.cpl

    • Performance Monitor
      perfmon.msc

    • Performance Monitor
      perfmon

    • Phone and Modem Options
      telephon.cpl

    • Power Configuration
      powercfg.cpl

    • Printers and Faxes
      control printers

    • Printers Folder
      printers

    • Private Character Editor
      eudcedit

    • Quicktime (If Installed)
      QuickTime.cpl

    • Regional Settings
      intl.cpl

    • Registry Editor
      regedit

    • Remote Desktop
      mstsc

    • Removable Storage
      ntmsmgr.msc

    • Removable Storage Operator Requests
      ntmsoprq.msc

    • Resultant Set of Policy (XP Prof)
      rsop.msc

    • Scanners and Cameras
      sticpl.cpl

    • Scheduled Tasks
      control schedtasks

    • Security Center
      wscui.cpl

    • Services
      services.msc

    • Shared Folders
      fsmgmt.msc

    • Shuts Down Windows
      shutdown

    • Sounds and Audio
      mmsys.cpl

    • Spider Solitare Card Game
      spider

    • SQL Client Configuration
      cliconfg

    • System Configuration Editor
      sysedit

    • System Configuration Utility
      msconfig

    • System File Checker Utility (Scan Immediately)
      sfc /scannow

    • System File Checker Utility (Scan Once At Next Boot)
      sfc /scanonce

    • System File Checker Utility (Scan On Every Boot)
      sfc /scanboot

    • System File Checker Utility (Return to Default Setting)
      sfc /revert

    • System File Checker Utility (Purge File Cache)
      sfc /purgecache

    • System File Checker Utility (Set Cache Size to size x)
      sfc /cachesize=x

    • System Properties
      sysdm.cpl

    • Task Manager
      taskmgr

    • Telnet Client
      telnet

    • Traceroute
      tracert

    • User Account Management
      nusrmgr.cpl

    • Utility Manager
      utilman

    • Windows Firewall
      firewall.cpl

    • Windows Magnifier
      magnify

    • Windows Management Infrastructure
      wmimgmt.msc

    • Windows System Security Tool
      syskey

    • Windows Update Launches
      wupdmgr

    • Windows XP Tour Wizard
      tourstart

    • Wordpad
      write

May 09, 2005

Windows Server 2003 - issue with web service event logging.

I came across one problem when web service tried to enter log in windows event log, an exception occurred related to write access.

This problem caused because of default ACL settings in Windows server 2003. The ACL (Access Control Layer) prohibits web service to write log entries.

This problem can be solved by changing ACL settings in registry:

HKEY_LOCAL_MACHINE/System/CurrentControlSet/Application

Locate the CustomSD key and add the following string to the existing value:

(A;;0x0002;;;AU)

Check this KB article too...


March 17, 2005

Command line reference for Windows, Bash, Oracle, and SQL Server

Here is site which has Command line reference for Windows, Bash, Oracle, and SQL Server...

February 12, 2005

Commands related to windows service

Commands related to windows service...

net stop serv-u

sc delete serv-u


From VS .Net command prompt:

installutil serv

installutil /u serv

August 31, 2004

Extending explorer context menu

Copy-paste code in notepad & save as .reg file. Finally run the file to update registry.

Register/unregister dll

Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\.dll]
"Content Type"="application/x-msdownload"
@="dllfile"
[HKEY_CLASSES_ROOT\dllfile]
@="Application Extension"
[HKEY_CLASSES_ROOT\dllfile\Shell\Register dll\command]
@="regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\UnRegister dll\command]
@="regsvr32.exe /u \"%1\""


Register/unregister ocx 
Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\.ocx]
@="ocxfile"
[HKEY_CLASSES_ROOT\ocxfile]
@="OCX"
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register ocx\command]
@="regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\UnRegister ocx\command]
@="regsvr32.exe /u \"%1\""



Open With Notepad

Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\*\shell]
@="\"notepad.exe %1\""
[HKEY_CLASSES_ROOT\*\shell\open]
@="Open &With Notepad"
[HKEY_CLASSES_ROOT\*\shell\open\command]
@="notepad.exe %1"
 

December 16, 2002

Tools in the Windows 2000 Resource Kit

The MS page has info on tools in the Windows 2000 Resource Kit. The tools in the Resource Kit help you perform administrative tasks, automate software installation, and with other jobs.

The MS page has info on tools in the Windows 2000 Resource Kit. The tools in the Resource Kit help you perform administrative tasks, automate software installation, and with other jobs.

July 17, 2002

UNIX Command Summary

http://www.utexas.edu/cc/docs/ccug1/commandsum.html

December 09, 2001

Always Top

SetWindowPos API determines position of your window:

Declare Function SetWindowPos Lib "user32" ( _
ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2

public sub SetFormOnTop(myForm as object)
SetWindowPos myForm.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE
end sub