Friday, July 8, 2011

Using CScript iisapp.vbs

The command-based script host (CScript.exe) is used to run the VbScripts or JScripts. In our case we would use the iisapp.vbs to ascertain the worker process IDs. At times while debugging we need to attach to processes, we generally attach all the instances of w2wp, since we are not sure which one is being used by our application. Definitely is an overhead, unnecessarily we take the overload of other processes which are not required at all. This is where this VbScript comes handy, I use it regularly and if you are developing something on SharePoint, then for sure you will be benefited.

I will straight way show you how to use it and later get into the details.
1.    Go to command prompt (run->cmd)
2.    Go to system32, the prompt should be like -
Write C:\>cd WINDOWS\system32 and you will reach C:\WINDOWS\system32>
Since the cscript.exe  resides here.
3.    Next command is – cscript iisapp.vbs
And you get all the w3wp.exe with process id with AppPool id.

C:\WINDOWS\system32>cscript iisapp.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

W3WP.exe PID: 8104   AppPoolId: SharePoint - 7011
W3WP.exe PID: 8080   AppPoolId: SharePoint Central Administration v3
W3WP.exe PID: 7600   AppPoolId: SharePoint - 7010
W3WP.exe PID: 148   AppPoolId: MyWebApp

Now you have the liberty to attach the desired process only. J

If this helps...... then please share......

HaPpY CoDiNg... (Aurum)

No comments:

Post a Comment