gunsmokingman Posted February 21, 2006 Posted February 21, 2006 (edited) Here is a VBS Script that will make a HTA, then it will list which programs are configured to automatically run each time Windows starts. This means it will check all Run, RunOnce, RunOnceEx Reg keys in all the registry places, and then it checks in the Alluser, User, start up folder, Dim Act, Cname, Dtop, Fso, SD, Ts, Uname Set Act = CreateObject("Wscript.Shell") Cname = Act.ExpandEnvironmentStrings("%Computername%") Uname = Act.ExpandEnvironmentStrings("%Username%") Dtop = Act.SpecialFolders("Desktop") SD = Act.ExpandEnvironmentStrings("%Systemdrive%") Set objWMIService = GetObject("winmgmts:\\" & Cname & "\root\cimv2") Set colStartupCommands = objWMIService.ExecQuery("Select * from Win32_StartupCommand") Set Fso = CreateObject("Scripting.FileSystemObject") Set Ts = Fso.OpenTextFile(Dtop & "\" & Cname & "_ListStartUp.hta",2,True) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' START OF HTA Ts.WriteLine "<html xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:o=""urn:schemas-microsoft-com:office:office"""_ & " xmlns:w=""urn:schemas-microsoft-com:office:word"" xmlns=""http://www.w3.org/TR/REC-html40"">"_ & " <html><head><TITLE> " & CName &" List Start Up Items</TITLE>" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' BODY FOR IT BGCOLOR AND TEXT Ts.WriteLine "<STYLE>Body.Normal{font:8.75pt;font-family:Palatino-Linotype;color:#006c6c;"_ & " filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#e8e4de', EndColorStr='#5e9ab9')}</STYLE> " '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' TD BACKGROUND COLOR Ts.WriteLine " <STYLE> td.Ed1{font:8.75pt;font-family:Palatino-Linotype;color:#000080;filter:progid:DXImageTransform.Microsoft.Gradient"_ & " (GradientType=0,StartColorStr='#e8e4de',endColorStr='#6ba7c6');} </STYLE>" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' VBS SCRIPT Ts.WriteLine " <script language=""vbscript""> window.resizeTo 700,375 : window.MoveTo 55,75" &_ vbCrLf & "</Script>" Ts.WriteLine " <Body Class=""Normal""> <Table><TD class=""Ed1"" width=""675"" Align=""CENTER"">Script Was Run By, " &_ Uname & " " & Now() & "</TABLE></TD><BR>" For Each objStartupCommand in colStartupCommands Ts.WriteLine " <Table><TD class=""Ed1"" width=""675"" Align=""LEFT"">Command: " & objStartupCommand.Command & "<BR>" Ts.WriteLine " Description: " & objStartupCommand.Description & "<BR>" Ts.WriteLine " Location: " & objStartupCommand.Location & "<BR>" Ts.WriteLine " Name: " & objStartupCommand.Name & "<BR>" Ts.WriteLine " User: " & objStartupCommand.User & "<BR>" Ts.WriteLine " </TABLE></TD><BR>" Next Ts.Close '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' RUNS THE HTA ASK TO KEEP OR DELETE Act.Run(Chr(34) & Dtop & "\" & Cname & "_ListStartUp.hta" & Chr(34)),1,True ZZ1 = MsgBox(Uname & ", Did You Want To Keep This File?" & vbCrLf & Dtop & "\" & Cname & "_ListStartUp.hta" &_ vbCrLf & vbTab & "Yes To Keep The File" & vbTab & "No to Delete The File", 4 + 32, "Keep Or Delete") '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' DELETES THE FILE IF USER DOES NOT WANT TO KEEP IT If ZZ1 = 7 Then Fso.DeleteFile(Dtop & "\" & Cname & "_ListStartUp.hta") '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''' DELETES THE SCRIPT AFTER IT BEEN EXTRACTED FROM THE SFX If Fso.FileExists(SD & "\ListStartUp_V1.vbs") Then Fso.DeleteFile(SD & "\ListStartUp_V1.vbs")Title Edited - Please follow new posting rules from now on.--Zxian Edited April 22, 2008 by gunsmokingman
Zxian Posted February 21, 2006 Posted February 21, 2006 Good work gunsmokingman. This makes it nice and simple to check what programs are run at startup, and where the possible problem might lie.
gunsmokingman Posted February 21, 2006 Author Posted February 21, 2006 Thanks I may add some checkboxes to it later to remove any of the entries listed, if the people want it.
LLXX Posted February 22, 2006 Posted February 22, 2006 AutoRuns from Sysinternals and HiJackThis performs the same purpose...
gunsmokingman Posted February 22, 2006 Author Posted February 22, 2006 AutoRuns from Sysinternals and HiJackThis performs the same purpose...Do they have to be installed? Since this is a VBS script there is nothing to install.
gunsmokingman Posted February 22, 2006 Author Posted February 22, 2006 Cool did not know that, but since I like using Built in Microsoft stuff that why I wrote the script.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now