How to read User and System Variables using VBScript

Quite easy! Dim objWSHDim objUserVariablesDim objSystemVariables Set objWSH =  CreateObject(“WScript.Shell”)‘This actually returns all the User Variables, and you either loop through all, or simply print what you wantSet objUserVariables = objWSH.Environment(“USER”) MsgBox(objUserVariables(“TEMP”)) ‘This returns all the System Variables, and you either loop through all, or simply print what you wantSet objSystemVariables = objWSH.Environment(“SYSTEM”)MsgBox(objSystemVariables(“PATH”)) ‘Say you want…


Are you getting OutOfMemoryExceptions when uploading large files?

Getting OutOfMemoryExceptions when uploading large files is a very common problem and we troubleshoot it quite frequently at Microsoft GTSC. JohanS has a very nice entry on his blog and I can’t resist myself to link to the solution which he provided! <snip>Problem:Using the WebClient.Upload method for posting large files will eventually leave you stranded with OutOfMemoryExceptions. Cause:WebClient.Upload…


Yippee!! VS 2005 SP 1 is available now… Finally!!! :)

I am so happy to see the Visual Studio 2005 Service Pack 1 (SP1) being released (finally)! Know more about it here! I am too excited to write more Click, Install, Enjoy!!! -Rahul


Open EXCEL file with VB6 and read the content

I was planning to write an application today which simply opens an Excel file and read the Cell values into an array so that I could manipulate it accordingly. Since I don’t have VS.NET installed on my home PC, I decided to do it with VB6 :o) Here is the code… Private Sub cmdOpenExcel_Click()On Error…


Network Monitor

Quite often, we need to analyze Network traces to find out if the issue is something related to IIS… or the Client… or the Network (say, firewall, proxy etc.) itself. Although we have a specialized team in Microsoft PSS (Product Support Services) who has the expertise to analyze the Network traces in general, there are quite a…


Executing a simple C# CGI.exe from IE address bar throws error

Not that I recommend CGI, but recently I found an interesting issue. Whenever we tried to execute an CGI exe from the IE address bar directly (http://localhost/cgiapps/ConsoleCGIApp.exe), it used to throw an error message like… Unhandled Exception: System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark,…


Some links and links to links for User mode debugging

This one is supposed to be a a handy list (of links and links to links :o) which I will maintain about the Debugging related stuff. 1. Link of Links by Doug Stewart2. A six part series on writing an extension for CDB/Windbg/NTSD3. Mike Taulty’s explanation – 1 (very good for beginners)4. Mike Taulty’s explanation…


Internet Explorer Developer Toolbar

Basically, I am a server side guy dealing with IIS, ASP, ASP.NET etc and not too much into Client side scripting and all. But this is something which caught my eyes BIG TIME It is called Internet Explorer Developer Toolbar and can be downloaded here. Is is amazing. I believe it is still in Beta…


Logparser Scenario 6:Searching files for culprits when you don’t have Visual Studio on the Server.

This blog entry is a continuation of the KB Article Scenario 6: Searching for any specific text in all the files of a folder. A small background of the problemRecently we saw a very interesting problem. Users of a website were seeing other user’s data in ASP.NET. There is cool blog entry about it…