Plamdi

Lotsa goodies - shell extensions, oem installer, toolbar removal

5 posts in this topic

Feel free to pin this topic! Cause everyone gunna want SOMETHING in it! :thumbup

Please Note: The line breaks appear to be in Unix mode, which means they do not correctly render when pasted into Notepad. For this reason I've replaced all references to Notepad with Wordpad, please paste into to Wordpad not Notepad to save as it does handle Unix line breaks correctly!

Okay, some of you have probably forgotten I've ever contributed my own little VBS files, so here they are... all shell extensions can be installed silently with either /S or /SILENT (case-insensitive), and all can be uninstalled through "Add/Remove Programs" (or by simply running the VBS file). Also every shell-extension file copies itself to its installation destination, which is usually in SYSTEM32. All are designed for Windows NT (2000, XP, etc) - I don't know if they'll work with Win9x.

Here's a list of all my programs in this post, with a quick explination of what it does:

  • Run with arguments - allows one to right-click a file and select "run with arguments" to run the file using command-line arguments.
  • Image conversion shell extension - allows one to right-click image files and convert to another format.
  • Directory usage - allows one to right-click a directory (folder) and click "show directory usage", which is then displayed in Wordpad.
  • Quick find - a cheap and nasty search feature added to the context-menu on folders.
  • OEM Installer - installs programs without user interaction. Intended for use with unattended Windows setups.
  • Remove toolbars - silently, and automatically removes Google and Yahoo toolbars. Intended for use with unattended setups.
  • Set archives - this replaces some file-types with different icons.

There are more in the next post!

1. Run With Arguments.
 
This VBS file adds to your context menu "Run With Argument", and it does exactly what it says. Paste into Wordpad, save as RUNWARGS.VBS.
 

' © 2006 aractus.com, this file must not be sold, you may distribute it' freely so long as it remains unmodified with all internal documentation.'' This program allows you to run any program with arguments, simply' right click and select "Run With Arguments" once installed. It is' uninstallable from Add or Remove Programs - or by running the' file directly.'' Installation:' 1. Double click on i_conv.vbs to install/uninstall' 2. Run "WScript.exe i_conv.vbs" from a command prompt or the run dialogue.' 3. Run "WScript.exe i_conv.vbs /s" to achieve a silent installation.Option Explicit:On Error Resume NextDim WshShell,fso,a,f,i,o,p,q(10),t,u,v,w:w=0Set WshShell=WScript.CreateObject("WScript.Shell")Set fso=CreateObject("Scripting.FileSystemObject")p=UCase(WshShell.Environment("PROCESS")("SystemRoot"))&"\SYSTEM32\"If UCase(WScript.ScriptFullName)<>p&"RUNWARGS.VBS" Then fso.CopyFile WScript.ScriptFullName,p&"runwargs.vbs"If Wscript.Arguments.Count=1 ThenIf Wscript.Arguments(0)="/REM" Thenv=MsgBox("Are you sure you want to remove the Run With Arguments shell extensions?",292,"Remove shell extensions confirmation")If v=7 Then WshShell=Nothing:Wscript.Quit(1)w=7ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Thenw=6ElseErrHndlr()End IfElseIf Wscript.Arguments.Count=2 ThenIf Wscript.Arguments(0)="/RUN" Thenw=InputBox(Wscript.Arguments(1)&"."&vbCrLf&vbCrLf&"Enter command line arguments below.","Run With Arguments")WshShell.Run(Wscript.Arguments(1)&" "&w)Set WshShell=NothingWscript.Quit(1)ElseErrHndlr()End IfEnd Ifq(0)="com":q(1)="exe":q(2)="bat":q(3)="cmd":q(4)="lnk":q(5)="vbs":q(6)="vbe":q(7)="js":q(8)="jse":q(9)="wsf":q(10)="wsh"If w=0 Then w=MsgBox("Do you want the Run With Arguments shell extensions?",292,"Enable/Disable shell extensions")For i=0 To UBound(q)a=WshShell.RegRead("HKCR\."&q(i)&"\")If a<>"" Thent="HKCR\"&a&"\shell\"&"Run_With_Args\"If w=6 ThenWshShell.RegWrite t,"Run With Arguments"WshShell.RegWrite t&"command\","WScript.exe """&p&"runwargs.vbs"" /RUN ""%d"""ElseWshShell.RegDelete t&"command\":WshShell.RegDelete tEnd Ift="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\runwargs\"If w=6 ThenWshShell.RegWrite t,""WshShell.RegWrite t&"DisplayName","Run With Arguments Shell Extensions (Removal)"WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"runwargs.vbs"" /REM"WshShell.RegWrite t&"NoModify",1,"REG_DWORD"WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"ElseWshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete tfso.DeleteFile(p&"runwargs.vbs")End IfEnd IfNext'iSet WshShell=NothingWscript.Quit(1)sub ErrHndlr()MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"runwargs.vbs error"Set WshShell=NothingWscript.Quit(0)End Sub


 
2. Image Conversion Shell Extension.

This is even better then the above shell extension, because it allows you to convert image files between common formats right from the context menu. This extension requires IrfanView to be installed. Paste into Wordpad, save as I_CONV.VBS.
 

' (c) 2006-2014 aractus.com, this file must not be sold, you may distribute it' freely so long as it remains unmodified with all internal documentation.'' This program is designed for use with IrfanView. It will add or remove' shell extensions for converting between several popular image formats.' If required you could add more to the list.' In no way am I affiliated with IrfanView.'' Installation:' 1. Double click on i_conv.vbs to install/uninstall' 2. Run "WScript.exe i_conv.vbs" from a command prompt or the run dialogue.' 3. Run "WScript.exe i_conv.vbs /s" to achieve a silent installation.'' Usage:' Right click a picture with a supported format (by default BMP, PNG, GIF,' JPG and ICO) and click "Convert to XXX" Where XXX is desired type.'' Notes on installation:' i_conv.vbs can be run from anywhere to install so long as IrfanView is' installed. If IrfanView isn't found the script will not install the' extensions, but will uninstall if asked. If IrfanView was not installed' correctly, or if it isn't found automatically with installation simply' copy this file to the IrfanView folder and run from there.'' When this file is run it will automatically place a copy into your' IrfanView folder (where possible), and you can delete any other installation' point as it will not be needed.'' You can uninstall the shell extensions through "Add or Remove Programs" in' Control Panel. Uninstallation will not delete i_conv.vbs, delete the file' manually if required.'' If you prefer you can use /silent instead of /s. Silent installations' suppress error messages if it cannot be installed.'' Other Notes:' This will also write a configuration file for use exclusively with the shell' extensions. You can modify it at any time. It is put in a new folder named' "i_conv".' --------------------------------------------------------------------------' Define variables.Option ExplicitOn Error Resume NextDim WshShell,fso,a,f,i,j,o,p,p2,t,u,v,w:w=0Set WshShell=WScript.CreateObject("WScript.Shell")Set fso=CreateObject("Scripting.FileSystemObject")p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))If Wscript.Arguments.Count=1 Then  If Wscript.Arguments(0)="REM" Then' This is invoked from "Add or Remove Programs".    v=MsgBox("Are you sure you want to remove the image-conversion shell extensions?",292,"Remove shell extensions confirmation")    If v=7 Then WshShell=Nothing:Wscript.Quit(1)    w=7  ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Then' If We are running a silent install preset variables.    w=6  Else' We have invalid command parameters.    ErrHndlr()  End If' This is the part used for conversion, it's extremely simple - it takes two' variables, one is a file name, the other a file extensions - such as BMP and' JPG, and tells IrfanView to convert file name to file format, after checking' if destination file exists, and if necessary asking the user whether to' overwrite or not.ElseIf Wscript.Arguments.Count=2 Then  t=Wscript.Arguments(0):u=Wscript.Arguments(1)  For i=Len(t) To 2 Step -1    If Mid(t,i,1)="." Then Exit For  Next'i  If i=1 Then ErrHndlr()' We have invalid command parameters.  v=Right(t,Len(t)-i)  If v=UCase(v)Then u=UCase(u)  u=Left(t,i)&u  If fso.fileexists(u) Then    v=MsgBox("Destination file exists, ok to overwrite?",292,"Overwrite confirmation")    If v=7 Then WshShell=Nothing:Wscript.Quit(1)  End If  WshShell.Run(""""&p&"i_view32.exe"" """&t&""" /convert="""&u& """ /ini="""&p&"i_conv"""),1  Set WshShell=Nothing  Wscript.Quit(1)ElseIf Wscript.Arguments.Count<>0 Then' We have invalid command parameters.  ErrHndlr()End If' Everything after this is only run if you open the file directly. This means' you either want to set up the shell extensions, or remove them. We check' first for IrfanView, and if we can't find it then installing the shell' extensions will be disabled.If fso.fileexists(p&"i_view32.exe") Then  If UCase(WScript.ScriptFullName)<>UCase(p&"I_CONV.VBS") Then' If IrfanView is found in the folder this file is run from, and i_conv.vbs' is incorrectly named, create a usable copy called i_conv.vbs.' Otherwise we are sweet to go!    fso.CopyFile WScript.ScriptFullName,p&"i_conv.vbs"  End IfElse' IrfanView wasn't found in the folder that i_conv.vbs was run from, so let's' search for it.. best place to look first is in the registry, IrfanView' doesn't have it's own key under HKLM\SOFTWARE, so we'll see if it's' uninstall entry will point the way.  p=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IrfanView\UninstallString")  p=Left(p,Len(p)-16)  p2=WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\IrfanView\UninstallString")  p2=Left(p2,Len(p2)-16)' If IrfanView is found then all we need do is put i_conv.vbs into its folder.' We check two locations for 64bit Windows.  If fso.fileexists(p&"i_view32.exe") Then    fso.CopyFile WScript.ScriptFullName,p&"i_conv.vbs"  ElseIf fso.fileexists(p2&"i_view32.exe") Then    p=p2    fso.CopyFile WScript.ScriptFullName,p&"i_conv.vbs"' We still haven't found IrfanView... so the other place to look is in the' computer's Program Files folder. We won't find it if the user has installed' to a personalized location.' As above we will need to put i_conv.vbs in the IrfanView folder.  ElseIf fso.fileexists(WshShell.Environment("PROCESS")("ProgramFiles")&"\irfanview\i_view32.exe") Then    p=WshShell.Environment("PROCESS")("ProgramFiles")&"\IrfanView\"    fso.CopyFile WScript.ScriptFullName,p&"i_conv.vbs"  ElseIf fso.fileexists(WshShell.Environment("PROCESS")("ProgramFiles(x86)")&"\irfanview\i_view32.exe") Then    p=WshShell.Environment("PROCESS")("ProgramFiles(x86)")&"\IrfanView\"    fso.CopyFile WScript.ScriptFullName,p&"i_conv.vbs"  Else' IrfanView was not found. Ask if user wants to uninstall extensions and exit.' Unless we're meant to be doing a silent install, in which case we'll just' end without alerting the user.    If w=6 Then      WshShell=Nothing:Wscript.Quit(0)    ElseIf w<>7 Then      v=MsgBox("IrfanView not found. Would you like to remove the shell extensions?",292,"Remove shell extensions")      If v=7 Then WshShell=Nothing:Wscript.Quit(1)    End If  End IfEnd If' OK we're now ready to add or remove the shell extensions!' Define the image formats we are going to use - I've included 5 as default,' feel free to add more just remember to change the declaration of the "q"' array to the correct size. It is important that if you want to do this to' first remove the shell extensions before modifying the file.Dim q(6):q(0)="bmp":q(1)="gif":q(2)="ico":q(3)="jp2":q(4)="jpg":q(5)="lwf":q(6)="png"' Ask user for input, unless we already know to install/uninstall that is.If w=0 Then w=MsgBox("Do you want the image-conversion shell extensions?",292,"Enable/Disable shell extensions")' Write a custom .ini file for use with conversions, you may customize this' but it's probably easier to edit the .ini once it's installed.If w=6 Then  o="[PNG]"&vbCrLf&"CompressionLevel=6"&vbCrLf&"[JPEG]"&vbCrLf&"Save Quality=85"&vbCrLf&"Save Progressive=0"&vbCrLf&_    "Save Grayscale=0"&vbCrLf&"KeepExif=0"&vbCrLf&"KeepCom=0"&vbCrLf&"KeepIptc=0"&vbCrLf&"[MultiGIF]"&vbCrLf&_    "SaveInterlaced=0"&vbCrLf&"SaveTransparent=0"&vbCrLf&"UsePalette=0"&vbCrLf&"Transparency=0"  fso.CreateFolder(p&"\i_conv"):fso.DeleteFile(p&"\i_conv\i_view32.ini")  Set f=fso.CreateTextFile(p&"\i_conv\i_view32.ini", True):f.Write o:f.CloseElse' Or delete it if we're uninstalling.  fso.DeleteFile(p&"\i_conv\i_view32.ini")  fso.DeleteFolder(p&"\i_conv")End If' Go through the registry and make the necessary changes...For i=0 To UBound(q)  a=WshShell.RegRead("HKCR\."&q(i)&"\")  If a<>"" Then    a="HKCR\"&a&"\shell\"    For j=0 To UBound(q)      If i<>j Then        t=a&"Convert_to_"&UCase(q(j))&"\"        If w=6 Then          WshShell.RegWrite t,"Convert to "&UCase(q(j))          WshShell.RegWrite t&"command\","WScript.exe """&p&"i_conv.vbs"" ""%d"" "&q(j)        Else          WshShell.RegDelete t&"command\":WshShell.RegDelete t        End If      End If    Next'j    t=a&"Remove_Image_Conversion_Shell_Extensions\"    t="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\i_conv\"    If w=6 Then      WshShell.RegWrite t,""      WshShell.RegWrite t&"DisplayName","Image Conversion Shell Extensions (Removal)"      WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"i_conv.vbs"" REM"      WshShell.RegWrite t&"NoModify",1,"REG_DWORD"      WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"    Else      WshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"      WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete t    End If  End IfNext'iSet WshShell=NothingWscript.Quit(1)sub ErrHndlr()  MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"i_conv.vbs error"  Set WshShell=Nothing  Wscript.Quit(0)End Sub


 
3. Directory Usage.

This VBS file adds to your context menu "Show Directory Usage", and does exactly that when clicked. It requires Du from Sysinternals. Paste into Wordpad, save as DIRINFO.VBS.
 

' © 2006 aractus.com, this file must not be sold, you may distribute it' freely so long as it remains unmodified with all internal documentation.' Use this file with Du from Sysinternals. Copy Du.exe to %WINDIR%\SYSTEM32,' and then run this file to install the shell extension. You may now right click any' directory (folder) to view it's disk usage.Option Explicit:On Error Resume NextDim WshShell,fso,f,o,p,t,v,w,tmp:w=0Set WshShell=WScript.CreateObject("WScript.Shell")Set fso=CreateObject("Scripting.FileSystemObject")p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))If Wscript.Arguments.Count=1 ThenIf Wscript.Arguments(0)="/REM" Thenv=MsgBox("Are you sure you want to remove the directory-information shell extension?",292,"Remove shell extension confirmation")If v=7 Then WshShell=Nothing:Wscript.Quit(1)w=7ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Thenw=6Elsetmp=fso.GetSpecialFolder(2)&"\"&fso.GetTempNameWshShell.Run("cmd /c du -q """&Wscript.Arguments(0)&""">"""&tmp&""""),0,TrueSet f=fso.OpenTextFile(tmp,1)o="Directory Information For:"&vbCrLf&Wscript.Arguments(0)&vbCrLf&vbCrLf&f.ReadAllf.Closefso.DeleteFile(tmp)Set f=fso.CreateTextFile(tmp, True):f.Write o:f.CloseWshShell.Run("Wordpad """&tmp&""""),1,Truefso.DeleteFile(tmp)Set WshShell=NothingWscript.Quit(1)End IfElseIf Wscript.Arguments.Count<>0 ThenErrHndlr()End IfIf fso.fileexists(p&"du.exe") ThenIf UCase(WScript.ScriptFullName)<>UCase(p&"DIRINFO.VBS") Thenfso.CopyFile WScript.ScriptFullName,p&"dirinfo.vbs"End IfElseIf fso.fileexists(WshShell.Environment("PROCESS")("SystemRoot")&"\System32\du.exe") Thenp=WshShell.Environment("PROCESS")("SystemRoot")&"\System32\"fso.CopyFile WScript.ScriptFullName,p&"dirinfo.vbs"ElseIf w=6 ThenWshShell=Nothing:Wscript.Quit(0)ElseIf w<>7 Thenv=MsgBox("Du not found. Would you like to remove the shell extension?",292,"Remove shell extension")If v=7 Then WshShell=Nothing:Wscript.Quit(1)End IfEnd IfEnd IfIf w=0 Then w=MsgBox("Do you want the directory-information shell extension?",292,"Enable/Disable shell extension")t="HKCR\Folder\shell\show_dir_usage\"If w=6 ThenWshShell.RegWrite t,"Show Directory Usage"WshShell.RegWrite t&"command\","WScript.exe """&p&"dirinfo.vbs"" ""%d"""ElseWshShell.RegDelete t&"command\":WshShell.RegDelete tEnd Ift="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\dirinfo\"If w=6 ThenWshShell.RegWrite t,""WshShell.RegWrite t&"DisplayName","Directory Information Shell Extension (Removal)"WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"dirinfo.vbs"" /REM"WshShell.RegWrite t&"NoModify",1,"REG_DWORD"WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"ElseWshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete tfso.DeleteFile(p&"dirinfo.vbs")End IfSet WshShell=NothingWscript.Quit(1)sub ErrHndlr()MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"dirinfo.vbs error"Set WshShell=NothingWscript.Quit(0)End Sub


 
4. Quick Find.

Adds a cheap-and-nasty search feature to all folders, so you can right click and select "Quick Find" - this will search just that directory, and it's subdirectories. Paste into Wordpad, save as QFIND.VBS.
 

' © 2006 aractus.com, this file must not be sold, you may distribute it' freely so long as it remains unmodified with all internal documentation.' Wildcards not supported, just type in the search as a logical filename.' Example: File.Ext' You do not need to specify file extension, it is optional.Option Explicit:On Error Resume NextDim WshShell,fso,f,o,p,t,v,w,tmp:w=0Set WshShell=WScript.CreateObject("WScript.Shell")Set fso=CreateObject("Scripting.FileSystemObject")p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))If Wscript.Arguments.Count=1 ThenIf Wscript.Arguments(0)="/REM" Thenv=MsgBox("Are you sure you want to remove the quick find shell extension?",292,"Remove shell extension confirmation")If v=7 Then WshShell=Nothing:Wscript.Quit(1)w=7ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Thenw=6Elsew=LCase(InputBox("Searching Folder "&Wscript.Arguments(0)&"."&vbCrLf&vbCrLf&"Enter a partial filename to search for below, do not use wildcards.","Quick Find"))If w="" Then Wscript.Quit(0)v=InStrRev(w,".")If v<>1 ThenIf v=0 Thent="|find """&w&""""Elset="|find """&Left(w,v-1)&""""End IfElset=""End IfIf v<>0 And v<>Len(w) Thenv="|find """&Right(w,Len(w)-v+1)&""""Elsev=""End Iftmp=fso.GetSpecialFolder(2)&"\"&fso.GetTempNameWshShell.Run("cmd /c dir/a/b/s/oe/l """&Wscript.Arguments(0)&""""&t&v&">"""&tmp&""""),0,TrueSet f=fso.GetFile(tmp)If f.Size<>0 ThenWshShell.Run("Wordpad """&tmp&""""),1,TrueElseWScript.Echo "File Not Found."End Iffso.DeleteFile(tmp)Set f=NothingSet WshShell=NothingWscript.Quit(1)End IfElseIf Wscript.Arguments.Count<>0 ThenErrHndlr()End Ifp=WshShell.Environment("PROCESS")("SystemRoot")&"\System32\"fso.CopyFile WScript.ScriptFullName,p&"qfind.vbs"If w=0 Then w=MsgBox("Do you want the quick find shell extension?",292,"Enable/Disable shell extension")t="HKCR\Folder\shell\qfind\"If w=6 ThenWshShell.RegWrite t,"Quick Find"WshShell.RegWrite t&"command\","WScript.exe """&p&"qfind.vbs"" ""%d"""ElseWshShell.RegDelete t&"command\":WshShell.RegDelete tEnd Ift="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\qfind\"If w=6 ThenWshShell.RegWrite t,""WshShell.RegWrite t&"DisplayName","Quick Find Shell Extension (Removal)"WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"qfind.vbs"" /REM"WshShell.RegWrite t&"NoModify",1,"REG_DWORD"WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"ElseWshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete tfso.DeleteFile(p&"qfind.vbs")End IfSet WshShell=NothingWscript.Quit(1)sub ErrHndlr()MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"qfind.vbs error"Set WshShell=NothingWscript.Quit(0)End Sub


 
5. OEM Installer.

This is probably one the greatest of all my VBS creations. It isn't a shell-extension, it is a program for automated installations where the program doesn't support silent switches - or, displays dialogues, etc, when using said switches. It works very well, and all documentation required to use it is in the two files required. This requires two files, OEMINST.VBS, and OEMINST.INI, so paste the following code into Wordpad, and save as OEMINST.VBS and OEMINST.INI, respectively. There are some working examples in the .INI file.

OEMINST.VBS:
 

' OEM INSTALLER - The most efficient solution. © 2006 aractus.com'' Some programs do not come with silent/unattended installation options, and' sometimes those that do still require user input. OEM Installer effectively' plugs this hole. AutoIt is another solution. and it's probably a great' program, but this is open-source and written in VBScript! Nevertheless some' people recompile or edit installers, or write .exe programs to silently' install single programs with no personal configuration possible.'' This file is universal. You can use it on just about ANY installer. It can' fail only when two or more windows with the same name (one or more the same' as the program we are installing) are found on the system. But this should' not affect people who are planning on using this program to aid in silent' installations with fresh Windows installations - which is the intended use.' The program has outstanding Error handling, being truly fool-proof when' the ProcessCheck option is used!'' The entire program was written over 4 days, and was a far better use of my' time then doing nothing about it! But the real beauty of this program is' that it's VBS! End-Users will not even be aware this program has run,' seamlessly converting any installation to a sleek, professional automated' task. And best of all, YOU can edit this program for your own personal use,' AND learn from my programming (the first thing to learn is that I have awful' variable names)!'' This file is copyright, it is distributed as Freeware, please respect the' copyright and distribute only the original, unmodified OEMINST.VBS file.' You may distribute modified OEMINST.INI files, however please leave the' documentation that appears in it intact.'' Program documentation and syntax is in OEMINST.INIOption ExplicitOn Error Resume Next' We need to know what installation to automate!If Wscript.Arguments.Count<>1 Then WScript.Quit(0)' Define variables...Dim WshShell,i,j,ini,fso,f,s,s_,p,m1,m2,t,tmp,inst(),pCheck,pNames()Dim objWMIService,objProcess,colProcess,ProgName,ProgFlagsSet WshShell=WScript.CreateObject("WScript.Shell")Set fso=CreateObject("Scripting.FileSystemObject")Set objWMIService=GetObject("winmgmts:" _&"{impersonationLevel=impersonate}!\\.\root\cimv2")ini=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)+_InStrRev(WScript.ScriptName,".")-Len(WScript.ScriptName))&"INI"' p=path to OEM Installerp=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-_Len(WScript.ScriptName))ProgFlags="":pCheck=False:tmp=""' We need to have an ini file! It is allowed to be compressed with makecab.If Not fso.fileexists(ini) Then ' Check for ini fileini=Left(ini,Len(ini)-1)&"_"If fso.fileexists(ini) Then ' Check for compressed ini filetmp=WshShell.ExpandEnvironmentStrings("%TEMP%")&"\OEMINST.TMP"WshShell.Run "EXPAND """&ini&""" """&tmp&"""",0WScript.Sleep 300 ' Needed for the fso queryini=tmpIf Not fso.fileexists(ini) Then tmp="":Terminate(0) ' Not a valid cab fileElseTerminate(0) ' No ini fileEnd IfEnd If' Read ini file, dump it in a variable and close the file.' It's always good to close files as soon as possible. It' prevents problems on the system when a file is opened but not closed' due to a program crash, which often results in the file being' locked until a system-reboot!Set f=fso.OpenTextFile(ini,1)s=VbCrLf&f.ReadAll&VbCrLf&VbCrLff.Close' The following code looks for the program we want to automate in the' ini file. If it can't be found, then OEM Installer terminates.' If it can be found, variable "s" that holds the information we need' is reduced to holding just the required data. Also "s_" is used to' to hold "s" converted to uppercase... this saves us doing UCase(s)' too many times.t=VbCrLf&"["&UCase(Wscript.Arguments(0))&"]"m1=InStr(UCase(s),t)+Len(t)If m1=0 Then Terminate(0)m2=InStr(m1+3,s,VbCrLf&"[")If m2=0 Then m2=Len(s)s=Mid(s,m1,m2-m1)&VbCrLfs_=Ucase(s)' Now let's find out the name of the executable we're going to run.' If it's missing, OEM Installer terminates.' And if the executable can't be found OEM Installer terminates.m1=InStr(s_,VbCrLf&"PROGRAM")If m1=0 Then Terminate(0)m1=InStr(m1+3,s,"=")+1If m1=0 Then Terminate(0)m2=InStr(m1,s,VbCrLf)ProgName=Mid(s,m1,m2-m1)If Left(ProgName,2)="@\" Then ProgName=p&Right(ProgName,Len(ProgName)-2)If Not fso.fileexists(ProgName) Then Terminate(0)' Does our program have any switches? If it does we'll pass them on...' if it doesn't then we won't!m1=InStr(s_,VbCrLf&"SWITCHES")If m1<>0 Thenm1=InStr(m1+3,s,"=")+1If m1<>0 Thenm2=InStr(m1,s,VbCrLf)ProgFlags=" "&Mid(s,m1,m2-m1)End IfEnd If' Now we'll check for ProcessCheck entries...' and if they exist we'll add them to an array for later use.m1=1:i=-2:m2=0Dom2=InStr(m2+1,s_,VbCrLf&"PROCESSCHECK")If m2=0 Then m1=0i=i+1Loop While m1If i<>-1 Thenj=i:pCheck=TrueReDim pNames(i)m1=1:m2=1For i=0 To jm1=InStr(m1,s_,VbCrLf&"PROCESSCHECK")m1=InStr(m1+3,s,"=")+1If m1=0 Then Terminate(0)t=InStr(m1+3,s,VbCrLf)+1pNames(i)=Mid(s,m1,t-m1-1)Next'iEnd If' OperationTitle and OperationKeys are required.' First we'll check how many of each are in the ini file,' and we'll proceed if there's at least one of each -' so long as there's as many as each other.m1=1:i=-2:m2=0Dom2=InStr(m2+1,s_,VbCrLf&"OPERATIONTITLE")If m2=0 Then m1=0i=i+1Loop While m1m1=1:j=-2:m2=0Dom2=InStr(m2+1,s_,VbCrLf&"OPERATIONKEYS")If m2=0 Then m1=0j=j+1Loop While m1If i<0 OR i<>j Then Terminate(0)ReDim inst(i,1) 'Array for storing OperationTitles and OperationKeys' Now we'll read them into the array we prepared' Any problems (in the ini file) and it's time to terminate!m1=1:m2=1For i=0 To jm1=InStr(m1,s_,VbCrLf&"OPERATIONTITLE")m1=InStr(m1+3,s,"=")+1If m1=0 Then Terminate(0)t=InStr(m1+3,s,VbCrLf)+1inst(i,0)=Mid(s,m1,t-m1-1)m2=InStr(m2,s_,VbCrLf&"OPERATIONKEYS")m2=InStr(m2+3,s,"=")+1If m2=0 Then Terminate(0)t=InStr(m2,s,VbCrLf)+1inst(i,1)=Mid(s,m2,t-m2-1)Next'i' Reset variables and run installation file!j=0:s="":s_=""WshShell.Run(""""&ProgName&""""&ProgFlags)' This is the heart of OEM Installer!' Each command we are given from OperationTitle and OperationKeys in' oeminst.ini will now be carried out, in sequence.' As a fail-safe, if ProcessCheck is enabled we can terminate without' carrying out all the tasks if we find that none of the required' processes are running.For i=0 To UBound(inst)If inst(i,1)="[!]" ThenSet colProcess=NothingSet colProcess=objWMIService.ExecQuery _("Select * from Win32_Process Where Name = """&inst(i,0)&"""")For Each objProcess in colProcessobjProcess.Terminate()NextElseDo until WshShell.AppActivate(inst(i,0))WScript.Sleep 300If pCheck ThenIf CheckForProcess() Thenj=0Elsej=j+1If j=14 Then Terminate(1)End IfEnd IfLoopWshShell.SendKeys inst(i,1)End IfNext'iTerminate(1)Function CheckForProcess()CheckForProcess=FalseFor Each t in pNamesSet colProcess=NothingSet colProcess=objWMIService.ExecQuery _("Select * from Win32_Process Where Name = """&t&"""")For Each objProcess in colProcessCheckForProcess=TrueExit FunctionNextNextEnd FunctionFunction Terminate(eC)If tmp<>"" Then fso.DeleteFile(ini)Set objWMIService=NothingSet WshShell=NothingSet fso=NothingWScript.Quit(eC)End function


 
OEMINST.INI:
 

OEM Installer configuration file.This file may be compressed using makecab. Type "makecab oeminst.ini" withoutquotations at the command prompt and then delete oeminst.ini to do this.Bear in mid you'll have to decompress it with Expand to edit it. Don't renameoeminst.in_, it must be named with the extension .in_ in order to work.Please note that microsoft's "EXPAND.EXE" must be accessible through the path(not to worry though, it's in WINDOWS\SYSTEM32 unless you delete it).OEMINST.INI must be named according to oeminst.vbs. This allows youflexibility if you want to rename the file. For instance if you renameoeminst.vbs to oem_installer.vbs then the ini file must be namedoem_installer.ini - or oem_installer.in_ if it's compressed with makecab.See OEMINST.VBS for more information about this program!This file allows for oem installer to automate any installation defined inthis file. The command-line syntax for OEM Installer is:WSCRIPT OEMINST.VBS PROGRAMNAMEExample:wscript oeminst.vbs winampThis will run the automated installation for Winamp shown below. This isconfigured for Winamp 2.95.Configuration syntax is as follows:Every program should fall under a unique program name, where the programname is enclosed in square brackets - [PROGRAMNAME].Under this line you may define the following properties:Program (REQUIRED) - this is the path to the installation file to be run.Switches (OPTIONAL) - command line switches for the installation file.ProcessCheck (OPTIONAL) - instructs OEM Installer to check for process(es).OperationTitle (REQUIRED) - used with OperationKeys, sets an operation.OperationKeys (REQUIRED) - Sets an operation as explained above.Program -You must specify a complete path, or a path relative to OEM Installer.Paths relative to the installer should use "@\" to show the path starts "at"OEM Installer's directory.Examples that are acceptable:Program=C:\Installation Files\Winamp 2.95\Winamp295.exe[url="http://"]Program=@\Winamp295.exe[/url][url="http://"]Program=@\Winamp[/url] 2.95\Winamp295.exeExamples that are unacceptable:Program=%SystemDrive%\Winamp 2.95\Winamp295.exeProgram="C:\Installation Files\Winamp 2.95\Winamp295.exe"Environment Variables CANNOT BE USED, and do not encase in quotations!Switches -In many cases you will want to pass command-line switches to the installer.You may specify as many as you like, using normal syntax. Don't enclosein quotations (unless it's part of the one switch).Examples that are acceptable:Switches=/silentSwitches=/silent /installpath="%ProgramFiles%\Program Name"ProcessCheck -Although this is optional, adding this makes OEM Installer fool-proof andfail-safe! When processcheck is used OEM Installer will check to ensure thatat least one of the named processes is running, and if they aren't then itwill Terminate (after a short "grace period"). What this means is that if theinstallation was abnormally terminated, OEM Installer will stop waiting toprocess the next dialogue box and terminate. You can specify as manyprocesses as are necessary, just be sure to include ALL processes that willrun, including the original installer you launch - if appropriate the "subinstaller" that is launched from the main installer, and if appropriate theprogram name if the program itself is launched at the end of installation.You may add numbers to the end, or just specify multiple ProcessCheck=entries un-numbered, whichever you prefer.Examples that are acceptable:ProcessCheck=INSTALLFILE.EXEProcessCheck=INSTALLFILE.EXEProcessCheck=INSTALLFILE2.EXEProcessCheck=LAUNCHEDFILE.EXEProcessCheck01=INSTALLFILE.EXEProcessCheck02=INSTALLFILE2.EXEProcessCheck03=LAUNCHEDFILE.EXEExamples that are unacceptable:ProcessCheck=INSTALLFILE.EXE, INSTALLFILE2.EXE, LAUNCHEDFILE.EXEProcessCheck="INSTALLFILE.EXE"Each entry must be on a seperate line! Again, no quotations!OperationTitle, OperationKeys -This is the heart of the automation. OperationTitle generally means thetitle of the dialogue-box that is displayed on screen. For instance, whenyou open Notepad (without opening a file) the title is "Untitled - Notepad".OperationKeys generally means the keystrokes to send to the dialogue-box.These can be any keys on the keyboard, and use this format:Backspace - {BS}, {BREAK}, {CAPSLOCK}, {DEL}, {END}, {ENTER} or ~, {ESC},{HELP}, {HOME}, {INSERT} or {INS}, {NUMLOCK}, Page Down - {PGDN}, Page Up- {PGUP}, Print Screen - {PRTSC}, {SCROLLLOCK}, {TAB}, Down Arrow - {DOWN}Left Arrow - {LEFT}, Right Arrow - {RIGHT}, Up Arrow - {UP}, {F1}, {F2},{F3}, {F4}, {F5}, {F6}, {F7}, {F8}, {F9}, {F10}, {F11}, {F12}, {F13},{F14}, {F15}, {F16}, {+}, {^}, {~}, {%}, {(}, {)}, {[}, {]}, {{}, {}},Alt - %, Ctrl - ^, Shift Lock - +.All other keys can be specified as is. Use parentheses "()" if you want tocreate combination key-presses. Example: "%(~)"Again, don't encase in quotations. You may specify as many OperationTitle'sand OperationKeys' as you need, they will be run in chronological orderand you MUST have as many OperationTitle's as OperationKeys'. You cannumber them, but it isn't required.Examples that are acceptable:OperationTitle=Winamp Setup: SettingsOperationKeys={TAB}{TAB}N{TAB} {UP} {UP}{UP}{UP} ~OperationTitle=Winamp Setup: Winamp successfully installedOperationKeys=%{F4}OperationTitle01=Winamp Setup: SettingsOperationTitle02=Winamp Setup: Winamp successfully installedOperationKeys01={TAB}{TAB}N{TAB} {UP} {UP}{UP}{UP} ~OperationKeys02=%{F4}There is a special case. If instead of sending keystrokes you would liketo immediately terminate a process use this syntax:OperationTitle=PROGRAMNAME.EXEOperationKeys=[!]By specifying "[!]" OEM Installer will understand you want to kill a processinstead of sending keystrokes. You must specify the executable's name(including extension, but not including path) in this instance, rather thena dialogue-box title.Example:If at the end of installation program documentation is opened in Notepad,then you could use this line:OperationTitle01=NOTEPAD.EXEOperationKeys02=[!]Please note this would terminate ALL instances of Notepad indiscriminately.Two important points to remember:1. Do not use quotations around any expressions.2. Do not use "white space" on the right-hand side of expressions.However, you can use as much as you like on the left-hand side.Examples on point "2":OperationKeys01 ={TAB}{TAB}N{TAB} {UP} {UP}{UP}{UP} ~OEM installer will press:<TAB><TAB><LETTER-N><TAB><SPACE><UP><SPACE><UP><UP><UP><SPACE><ENTER>OperationKeys01 = {TAB}{TAB}N{TAB} {UP} {UP}{UP}{UP} ~OEM Installer will press:<SPACE!><TAB><TAB><LETTER-N><TAB><SPACE><UP><SPACE><UP><UP><UP><SPACE><ENTER>ProcessCheck02 =WINAMP.EXEOEM Installer will check for a process called "winamp.exe"ProcessCheck02 = WINAMP.EXEOEM Installer will check for a process called " winamp.exe"!Place installation syntax below this line, not above.-----------------------------------------------------------------------------[Winamp]Program [url="http://"]=@\WINA295.EXE[/url]Switches =/SProcessCheck01 =WINA295.EXEProcessCheck02 =WINAMP.EXEOperationTitle01 =Winamp Setup: SettingsOperationKeys01 ={TAB}{TAB}N{TAB}{UP} {UP} {UP}{UP} ~OperationTitle02 =Winamp Setup: Winamp successfully installedOperationKeys02 =%{F4}[DVD43]Program [url="http://"]=@\DVD43.EXE[/url]Switches =/SILENTProcessCheck =DVD43.EXEOperationTitle =ConfirmOperationKeys =N[Monkey's Audio]Program [url="http://"]=@\MACSETUP.EXE[/url]Switches =/SILENTProcessCheck01 =MACSETUP.EXEProcessCheck02 =Monkey's Audio.exeProcessCheck03 =Winamp Plugin.exeOperationTitle01 =Monkey's Audio Winamp PluginOperationKeys01 =~OperationTitle02 =Monkey's Audio 4.01OperationKeys02 =%{F4}[Unlocker]Program [url="http://"]=@\UNLOCKER.EXE[/url]Switches =/SProcessCheck01 =UNLOCKER.EXEProcessCheck02 =UnlockerAssistant.exeOperationTitle =UnlockerAssistant.exeOperationKeys =[!]


 
6. Remove Toolbars.

This file silently uninstalls both the Google and Yahoo toolbars, if present.

REMTOOLB.VBS
 

' © 2006 aractus.com. This file silently uninstalls the Yahoo! and Google Toolbars.Option Explicit:On Error Resume NextDim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2318C2B1-4965-11d4-9B18-009027A5CD4F}\UninstallString")If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Yahoo! Companion\UninstallString")If a<>"" Then WshShell.Run(""""&a&""" /S"),1,True:i=i+1WshShell=Nothing:Wscript.Quit(i)


 
It is the only file you need, however if you really only want to remove one and not the other (which I don't reccomend because they're both spyware) then you can use either of these:

REMYAHOO.VBS:
 

' © 2006 aractus.com. This file silently uninstalls the Yahoo! Toolbar.Option Explicit:On Error Resume NextDim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Yahoo! Companion\UninstallString")If a<>"" Then WshShell.Run(""""&a&""" /S"),1,True:i=i+1WshShell=Nothing:Wscript.Quit(i)


 
REMGOOGL.VBS:
 

' © 2006 aractus.com. This file silently uninstalls the Google Toolbar.Option Explicit:On Error Resume NextDim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2318C2B1-4965-11d4-9B18-009027A5CD4F}\UninstallString")WshShell=Nothing:Wscript.Quit(i)


 
On my original post, user chrismholmes contributed removal of some additional items. The ones that use SendKeys and Sleep I don't reccomend using like this, rather use OEM Installer above for these needs - it's a far more robust program for these needs and less prone to errors. It also waits for the programs to terminate before quitting, which is useful for RunOnceEX because your next item won't be processed until it is done. Anyway, here is a version that will also remove the AOL and Ask toolbars, so long as chrismholmes's code was correct (I have not tested it, use at your own discression):
 

' © 2008 aractus.com. This file silently uninstalls the Yahoo!, Google, Ask and AOL Toolbars.Option Explicit:On Error Resume NextDim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2318C2B1-4965-11d4-9B18-009027A5CD4F}\UninstallString")If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Yahoo! Companion\UninstallString")If a<>"" Then WshShell.Run(""""&a&""" /S"),1,True:i=i+1a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AOL Toolbar\Uninstallstring")If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ask Toolbar for Internet Explorer_is1\uninstallString")If a<>"" Then WshShell.Run(a&" /SILENT"),1,True:i=i+1WshShell=Nothing:Wscript.Quit(i)


 
7. Archive icons. These are useful it if annoys you (like it does me) when all zip, rar, 7z archives are set to appear as the same file type. The icons are attached, save them to System32 - and here is a custom file to set the icon for several archives types:

SETARCHIVES.CMD:
 

@ECHO OFFREG ADD HKCR\.iso /VE /D "isofile" /FREG ADD HKCR\.iso /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\isofile /VE /D "ISO Archive" /FREG ADD HKCR\isofile\DefaultIcon /VE /D "%SystemRoot%\System32\shell32.dll,188" /FREG ADD HKCR\.zip /VE /D "zipfile" /FREG ADD HKCR\.zip /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\zipfile /VE /D "ZIP Archive" /FREG ADD HKCR\zipfile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.tar /VE /D "tarfile" /FREG ADD HKCR\.tar /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\tarfile /VE /D "TAR Archive" /FREG ADD HKCR\tarfile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.gz /VE /D "gzipfile" /FREG ADD HKCR\.tgz /VE /D "gzipfile" /FREG ADD HKCR\.gz /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\.tgz /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\gzipfile /VE /D "gzip archive" /FREG ADD HKCR\gzipfile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.bz2 /VE /D "bzipfile" /FREG ADD HKCR\.tbz2 /VE /D "bzipfile" /FREG ADD HKCR\.tb2 /VE /D "bzipfile" /FREG ADD HKCR\.bz2 /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\.tbz2 /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\.tb2 /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\bzipfile /VE /D "bzip2 compressed file" /FREG ADD HKCR\bzipfile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.7z /VE /D "7zipfile" /FREG ADD HKCR\.7z /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\7zipfile /VE /D "7-Zip Archive" /FREG ADD HKCR\7zipfile\DefaultIcon /VE /D "%PROGRAMFILES%\7-Zip\7zFM.exe" /FREG ADD HKCR\.rar /VE /D "rarfile" /FREG ADD HKCR\.rar /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\rarfile /VE /D "RAR Archive" /FREG ADD HKCR\rarfile\DefaultIcon /VE /D "%SystemRoot%\System32\rar.ico" /FREG ADD HKCR\.lha /VE /D "lhafile" /FREG ADD HKCR\.lha /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\.lhz /VE /D "lhafile" /FREG ADD HKCR\.lhz /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\lhafile /VE /D "LHA Archive" /FREG ADD HKCR\lhafile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.ace /VE /D "acefile" /FREG ADD HKCR\.ace /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\acefile /VE /D "ACE Archive" /FREG ADD HKCR\acefile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /FREG ADD HKCR\.arj /VE /D "arjfile" /FREG ADD HKCR\.arj /V "Content Type" /D "application/x-zip-compressed" /FREG ADD HKCR\arjfile /VE /D "ARJ Archive" /FREG ADD HKCR\arjfile\DefaultIcon /VE /D "%SystemRoot%\System32\zip.ico" /F


 
8. There's also a great program called FavOrg that restores all your favourite icons for you, cause after all it's annoying as hell when you install fresh and there's no favicons in your favourites that you just copied back!!!

It's not my program, obviously, but everyone should have it! Get it here

9. And there is another extension I just LOVE called HashTab, Get it here! It adds MD5, SHA1 and CRC32 hashes to a tab in file properties, awesome!

That's all for now, like I said I recommend pinning this topic, as it's absolutely crammed with goodies!
 
17/07/2015 ... just changed the webaddress to my current website, and put everything in spoiler tags.

ICONS.7z

Edited by Plamdi
Code tags changed again to help with page formatting!
0

Share this post


Link to post
Share on other sites

Some more of my favourites!

These are some more extensions that are really handy to have, for PNG and JPEG.

  1. Edit PNG chunks - This requires the freeware tool TweakPNG. This is an incredibly, incredibly useful tool.
  2. Edit JPEG comments - This requires the freeware tool edjpgcom. This is also an incredibly, incredibly useful tool.

Edit PNG chunks... paste the following into Wordpad and save as pngchunk.vbs.

' © 2008 plamdi.com, this file must not be sold, you may distribute it
' freely so long as it remains unmodified with all internal documentation.
'
' This program is designed for use with TweakPNG. It will add or remove
' a shell extension for editing PNG image file chunks.
' In no way am I affiliated with TweakPNG.
'
' Installation:
' 1. Ensure there is a copy of TweakPNG (tweakpng.exe) located in your
' WINDOWS\SYSTEM32 directory.
' 1. Double click on pngchunk.vbs to install/uninstall
' 2. Run "WScript.exe pngchunk.vbs" from a command prompt or the run dialogue.
' 3. Run "WScript.exe pngchunk.vbs /s" to achieve a silent installation.
'
' Usage:
' Right click a PNG image file, and click "Edit PNG Chunks".
'
' Notes on installation:
' pngchunk.vbs can be run from anywhere to install so long as TweakPNG is in
' your SYSTEM32 directory. The script will not install the extension if
' TweakPNG isn't detected, but will uninstall if asked. If you wish to locate
' the file elsewhere, simply copy this file to the folder where TweakPNG
' resides and run from there.
'
' When this file is run it will automatically place a copy into your System32
' folder, you may delete any other installation point as it will not be needed.
'
' You can uninstall the shell extensions through "Add or Remove Programs" in
' Control Panel.
'
' If you prefer you can use /silent instead of /s. Silent installations
' suppress error messages if it cannot be installed.
'
' --------------------------------------------------------------------------

Option Explicit:On Error Resume Next
Dim WshShell,fso,f,o,p,t,v,w,tmp:w=0
Set WshShell=WScript.CreateObject("WScript.Shell")
Set fso=CreateObject("Scripting.FileSystemObject")
p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))
If Wscript.Arguments.Count=1 Then
If Wscript.Arguments(0)="/REM" Then
v=MsgBox("Are you sure you want to remove the edit-PNG-chunks shell extension?",292,"Remove shell extension confirmation")
If v=7 Then WshShell=Nothing:Wscript.Quit(1)
w=7
ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Then
w=6
Else
ErrHndlr()
End If
ElseIf Wscript.Arguments.Count<>0 Then
ErrHndlr()
End If
If fso.fileexists(p&"tweakpng.exe") Then
If UCase(WScript.ScriptFullName)<>UCase(p&"PNGCHUNK.VBS") Then
fso.CopyFile WScript.ScriptFullName,p&"pngchunk.vbs"
End If
Else
If fso.fileexists(WshShell.Environment("PROCESS")("SystemRoot")&"\System32\tweakpng.exe") Then
p=WshShell.Environment("PROCESS")("SystemRoot")&"\System32\"
fso.CopyFile WScript.ScriptFullName,p&"pngchunk.vbs"
Else
If w=6 Then
WshShell=Nothing:Wscript.Quit(0)
ElseIf w<>7 Then
v=MsgBox("TweakPNG not found. Would you like to remove the shell extension?",292,"Remove shell extension")
If v=7 Then WshShell=Nothing:Wscript.Quit(1)
End If
End If
End If
If w=0 Then w=MsgBox("Do you want the edit-PNG-chunks shell extension?",292,"Enable/Disable shell extension")
t=WshShell.RegRead("HKCR\.png\")
If t<>"" Then
t="HKCR\"&t&"\shell\edit_png_chunk\"
If w=6 Then
WshShell.RegWrite t,"Edit PNG Chunks"
WshShell.RegWrite t&"command\",""""&p&"tweakpng.exe"" ""%d"""
Else
WshShell.RegDelete t&"command\":WshShell.RegDelete t
End If
t="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\pngchunk\"
If w=6 Then
WshShell.RegWrite t,""
WshShell.RegWrite t&"DisplayName","Edit PNG Chunks Shell Extension (Removal)"
WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"pngchunk.vbs"" /REM"
WshShell.RegWrite t&"NoModify",1,"REG_DWORD"
WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"
Else
WshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"
WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete t
fso.DeleteFile(p&"pngchunk.vbs")
End If
End If
Set WshShell=Nothing
Wscript.Quit(1)

sub ErrHndlr()
MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"pngchunk.vbs error"
Set WshShell=Nothing
Wscript.Quit(0)
End Sub

Edit JPEG comments... paste the following into Wordpad and save as jpegcomm.vbs.

' © 2008 plamdi.com, this file must not be sold, you may distribute it
' freely so long as it remains unmodified with all internal documentation.
'
' This program is designed for use with Edjpgcom. It will add or remove
' a shell extension for editing JPEG image file comments.
' In no way am I affiliated with Edjpgcom.
'
' Installation:
' 1. Ensure there is a copy of Edjpgcom (edjpgcom.exe) located in your
' WINDOWS\SYSTEM32 directory.
' 1. Double click on jpegcomm.vbs to install/uninstall
' 2. Run "WScript.exe jpegcomm.vbs" from a command prompt or the run dialogue.
' 3. Run "WScript.exe jpegcomm.vbs /s" to achieve a silent installation.
'
' Usage:
' Right click a JPEG image file, and click "Edit JPEG Comments".
'
' Notes on installation:
' jpegcomm.vbs can be run from anywhere to install so long as Edjpgcom is in
' your SYSTEM32 directory. The script will not install the extension if
' Edjpgcom isn't detected, but will uninstall if asked. If you wish to locate
' the file elsewhere, simply copy this file to the folder where Edjpgcom
' resides and run from there.
'
' When this file is run it will automatically place a copy into your System32
' folder, you may delete any other installation point as it will not be needed.
'
' You can uninstall the shell extensions through "Add or Remove Programs" in
' Control Panel.
'
' If you prefer you can use /silent instead of /s. Silent installations
' suppress error messages if it cannot be installed.
'
' --------------------------------------------------------------------------

Option Explicit:On Error Resume Next
Dim WshShell,fso,f,o,p,t,v,w,tmp:w=0
Set WshShell=WScript.CreateObject("WScript.Shell")
Set fso=CreateObject("Scripting.FileSystemObject")
p=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))
If Wscript.Arguments.Count=1 Then
If Wscript.Arguments(0)="/REM" Then
v=MsgBox("Are you sure you want to remove the edit-JPEG-comments shell extension?",292,"Remove shell extension confirmation")
If v=7 Then WshShell=Nothing:Wscript.Quit(1)
w=7
ElseIf UCase(Wscript.Arguments(0))="/S" Or UCase(Wscript.Arguments(0))="/SILENT" Then
w=6
Else
ErrHndlr()
End If
ElseIf Wscript.Arguments.Count<>0 Then
ErrHndlr()
End If
If fso.fileexists(p&"edjpgcom.exe") Then
If UCase(WScript.ScriptFullName)<>UCase(p&"JPEGCOMM.VBS") Then
fso.CopyFile WScript.ScriptFullName,p&"jpegcomm.vbs"
End If
Else
If fso.fileexists(WshShell.Environment("PROCESS")("SystemRoot")&"\System32\edjpgcom.exe") Then
p=WshShell.Environment("PROCESS")("SystemRoot")&"\System32\"
fso.CopyFile WScript.ScriptFullName,p&"jpegcomm.vbs"
Else
If w=6 Then
WshShell=Nothing:Wscript.Quit(0)
ElseIf w<>7 Then
v=MsgBox("Edjpgcom not found. Would you like to remove the shell extension?",292,"Remove shell extension")
If v=7 Then WshShell=Nothing:Wscript.Quit(1)
End If
End If
End If
If w=0 Then w=MsgBox("Do you want the edit-JPEG-comments shell extension?",292,"Enable/Disable shell extension")
t=WshShell.RegRead("HKCR\.jpg\")
If t<>"" Then
t="HKCR\"&t&"\shell\edit_jpg_comm\"
If w=6 Then
WshShell.RegWrite t,"Edit JPEG Comments"
WshShell.RegWrite t&"command\",""""&p&"edjpgcom.exe"" ""%d"""
Else
WshShell.RegDelete t&"command\":WshShell.RegDelete t
End If
t="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\jpegcomm\"
If w=6 Then
WshShell.RegWrite t,""
WshShell.RegWrite t&"DisplayName","Edit JPEG Comments Shell Extension (Removal)"
WshShell.RegWrite t&"UninstallString","WScript.exe """&p&"jpegcomm.vbs"" /REM"
WshShell.RegWrite t&"NoModify",1,"REG_DWORD"
WshShell.RegWrite t&"NoRepair",1,"REG_DWORD"
Else
WshShell.RegDelete t&"NoModify":WshShell.RegDelete t&"NoRepair"
WshShell.RegDelete t&"UninstallString":WshShell.RegDelete t&"DisplayName":WshShell.RegDelete t
fso.DeleteFile(p&"jpegcomm.vbs")
End If
End If
Set WshShell=Nothing
Wscript.Quit(1)

sub ErrHndlr()
MsgBox "Invalid parameters were given. The only correct user command line is /s or /silent.",16,"jpegcomm.vbs error"
Set WshShell=Nothing
Wscript.Quit(0)
End Sub

0

Share this post


Link to post
Share on other sites

Quickfind vbs is not working its giving an error, can anyone help!!

0

Share this post


Link to post
Share on other sites
Quickfind vbs is not working its giving an error, can anyone help!!
I just tested the version I posted here, and it's working fine for me. Follow the following steps:

1. copy the code.

2. open WordPad (not Notepad).

3. paste the code into WordPad.

4. click save.

5. select "Text Document" under "File name", and not "Rich Text Format", and put QFIND.VBS in the file name.

6. Run qfind.vbs to install.

0

Share this post


Link to post
Share on other sites

Here is the code I used to remove Google, Yahoo!, AOL, and Ask, if anyone is having trouble with the colde from above. The previous code may be outdated (from chrisholmes)

Option Explicit:On Error Resume Next
Dim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2318C2B1-4965-11d4-9B18-009027A5CD4F}\UninstallString")
If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Yahoo! Companion\UninstallString")
If a<>"" Then WshShell.Run(""""&a&""" /S"),1,True:i=i+1
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AOL Toolbar\UninstallString")
If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{86D4B82A-ABED-442A-BE86-96357B70F4FE}\uninstallString")
If a<>"" Then WshShell.Run("MsiExec.exe /uninstall {86D4B82A-ABED-442A-BE86-96357B70F4FE} /qn"),1,True:i=i+1
WshShell=Nothing:Wscript.Quit(i)

I would like to see this added on to and used as a great login script to help prevent junk from accumulating on domain PCs

0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.