Aug 222012
 

Here is a quick way to attach to windbg.exe via vbscript and read dump files:

' VBScript source code
' The following WinDbg vbscript example will allow you to recursively search for *.deb files
' and analyse each one. The script will aso go to msdl.microsoft.com/download/symbols to 

' acquire any needed symbol files. 
'START
Set fso = CreateObject("Scripting.FileSystemObject") 
Set Folder = fso.GetFolder(".") 
Set Files = Folder.Files 
Set WshShell = CreateObject("WScript.Shell") 
ForEach File In Files 
If Mid(File.Name, Len(File.Name) -3, 4) = ".dmp"Then
Set oExec = WshShell.Exec("C:\Program Files\Debugging Tools for Windows\WinDbg.exe -y " & _
"srv*c:\ms*http://msdl.microsoft.com/download/symbols" & _
" -z " + File.Name + " -c ""$$><c:\scripts\MiniDmp2Txt.txt; q"" -Q -QS -QY -QSY") 

DoWhile oExec.Status = 0 
 WScript.Sleep 1000 
Loop
EndIf
Next
'END
 Posted by at 10:26 pm
Aug 212012
 

Probably the biggest mental leap you can make when moving from VBScript to PowerShell is that PowerShell is intended to deal with objects not text. That’s all well and good in theory, but it can be a confusing concept to implement until you get used to it. For example, look at ServicePack.vbs, which is a VBScript that reads a list of names from C:\Computers.txt (one name per line) and uses WMI to display the service pack version for each. Continue reading “using objects” »

 Posted by at 3:00 pm
Aug 202012
 

Use the following example to monitor service availibility for VDI’s and physical assets.

strComputer =  "."
Set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=Impersonate}!\\" & _
     strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery & _
    ("SELECT * FROM Win32_Service")
For Each objService in colServices
    Wscript.Echo objService.DisplayName & " = " & _
    objService.State
Next
 Posted by at 8:50 pm

Optimized by SEO Ultimate