Home Page Bahamas Software Bahamas Real Estate Bahamas Writer Business Services Contact Us

Computer Repair
Tel: 242-364-9183
Nassau, Bahamas
Bahamas Video Surveillance . Bahamas CCTV . Bahamas Infrared . Bahamas Digital Video . Bahamas Remote Video . Bahamas Burglar Alarm . Bahamas Technician
Bahamas Real Estate
Bahamas Yellow Pages


Free Software:


We Recommend:
MediaFire - Free File Hosting Made Simple
Follow us on:
Twitter Twitter


 

Startup Report

This script checks for programs that are on Windows Startup.
A temporary text report is displayed.

'// Startup Items

Option Explicit

Dim objReg, objFso, objShell
Dim TempFile, ComputerName, UserName
Dim strComputer, strKeyPath, strValue
Dim arrNames1, arrNames2
Dim arrTypes1, arrTypes2
Dim intRet1, intLoop
Dim x, y

const FileExt = "txt"
const HKCU    = &H80000001
const HKLM    = &H80000002

With CreateObject("WScript.Network")
    ComputerName = .ComputerName
    UserName = .UserName
End With

strComputer  = "."
Set objReg   = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
               strComputer & "\root\default:StdRegProv")
strKeyPath   = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

Set objFso   = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
TempFile     = objShell.ExpandEnvironmentStrings("%TEMP%") & "\Startup." & FileExt

With objFso.CreateTextFile(TempFile, True)

    .WriteLine WriteCode("----------------------------------------------------------")
    .WriteLine WriteCode("REPORT INFORMATION")
    .WriteLine WriteCode("==========================================================")
    .WriteLine WriteCode("")
    .WriteLine WriteCode("DESCRIPTION:   Startup Items")
    .WriteLine WriteCode("COMPUTER NAME: " & ComputerName)
    .WriteLine WriteCode("USER NAME:     " & UserName)
    .WriteLine WriteCode("DATE/TIME:     " & Now())
    .WriteLine WriteCode("")

    objReg.EnumValues HKLM, strKeyPath, arrNames1, arrTypes1
    If IsArray(arrNames1) Then
        x = UBound(arrNames1)
        If x > -1 Then
            .WriteLine WriteCode("----------------------------------------------------------")
            .WriteLine WriteCode("HKEY LOCAL MACHINE")
            .WriteLine WriteCode("==========================================================")
            .WriteLine WriteCode("")
            For intLoop = 0 To x
                objReg.GetStringValue HKLM, strKeyPath, arrNames1(intLoop), strValue
                .WriteLine "ITEM NAME: " & arrNames1(intLoop)
                .WriteLine WriteCode(strValue)
                .WriteLine WriteCode("")
            Next
        End If
    End if

    objReg.EnumValues HKCU, strKeyPath, arrNames2, arrTypes2
    If IsArray(arrNames2) Then
        y = UBound(arrNames2)
        If y > -1 Then
            .WriteLine WriteCode("----------------------------------------------------------")
            .WriteLine WriteCode("HKEY CURRENT USER")
            .WriteLine WriteCode("==========================================================")
            .WriteLine WriteCode("")
            For intLoop = 0 To y
                objReg.GetStringValue HKCU, strKeyPath, arrNames2(intLoop), strValue   
                .WriteLine "ITEM NAME: " & arrNames2(intLoop)
                .WriteLine WriteCode(strValue)
                .WriteLine WriteCode("")
            Next
        End If
    End If

    .WriteLine WriteCode("**********************************************************")
    .WriteLine WriteCode("*                                                        *")
    .WriteLine WriteCode("*  NOTE: This file will be deleted when you close it.    *")
    .WriteLine WriteCode("*  To retain this information, Print or Save as now.     *")
    .WriteLine WriteCode("*                                                        *")
    .WriteLine WriteCode("**********************************************************")
    .WriteLine WriteCode("")
    .WriteLine WriteCode("[Startup Report Generated by BahamasSecurity.com]")
    .Close
End With

On Error Resume Next
objShell.Run TempFile,,True
On Error GoTo 0

objFso.GetFile(TempFile).Delete

Set objFso   = Nothing
Set objShell = Nothing
Set objReg   = Nothing

Function WriteCode(sIn)
    If LCase(FileExt) = "htm" OR LCase(FileExt) = "html" Then
        WriteCode = sIn & "<br>"
    Else
        WriteCode = sIn
    End If
End Function


Bahamas CCTV . Bahamas DVR . Bahamas Camera . Bahamas Video . Bahamas Computer Repair . Bahamas Software . Bahamas Business . Bahamas Real Estate
Copyright (c) 2001/2010 BahamasSecurity.com