Two Visual Basic Scripts
Two Visual Basic Scripts
Example 1 is relatively simple. It concentrates on creating objShell and applying the .RegDelete method.
Example 2 is more complex, and introduces limited error correcting code. Moreover Example 2 creates a substitute REG_SZ value, which is the equivalent of renaming IsShortCut.
These scripts are designed for XP and Windows 2003. While they will work on Vista, as noted above, they produce ugly side-effects on icons in the Favourites folder.
Example 1: Basic Script To Remove The Arrow On Shortcuts
Instructions
Preliminary step: In order to give the script a chance, create a shortcut. For example, at the desktop, right-click, new, shortcut and type 'calc'. Press 'Finish' and the shortcut, complete with arrow will arrive on the desktop. Copy and paste the script below into notepad, or get a script editor such as OnScript. Save the file with .vbs extension e.g. NoArrowEg1.vbs Double click your VBScript, then 'OK' the message box. To help you understand what is happening in the Registry, I recommend that you launch regedit and navigate to the section specified by strRoot. Ah yes, to actually see the arrows disappear, simply logoff and logon again. The shortcuts should now have no arrows.' NoArrowEg1.vbs
' Example VBScript to remove arrows on shortcuts in XP
' and Windows 2003.
' Author Guy Thomas http: //computerperformance.co.uk
' Version 1.5 - March 2007
' ---------------------------------------------------------------'
'
Option Explicit
Dim objShell, strRoot, strRead, strDelete, strCreate
strRoot = "HKEY_CLASSES_ROOTlnkfileIsShortCut"
' Create the Shell object
Set objShell = CreateObject("WScript.Shell")
strDelete = objShell.RegDelete(strRoot)
WScript.Echo "Error No: " & err.number & " check " & strRoot
strDelete = null
WScript.Quit
' End of example script.
Learning Points
Check how VBScript creates the objShell object, then trace how .RegDelete performs its work on the Registry. In VBScript HKEY_CLASSES_ROOT can be abbreviated to HKCR. (There is also HKLM and HKCU.) Surprisingly, you cannot use HKCR or HKLM in .Reg files. The RegDelete method deletes an entry from the Registry based on strName. If strName ends with a backslash (), then strName is treated as a key, otherwise it is treated as a value. For completeness, you may wish to find other instances of IsShortCut, for example at: HKCRpiffile and HKCRWSHFile.- Previous page Introduction
- Next page Example 2: Full Script To Remove The...
- Gold View the Present and Future of Microsoft Vista In the Enterprise
- Sam & Max: The Comeback
- RuneScape Exposed Part 1: An Education Kids Don't Need
- PCI Express Scaling Analysis
- AMD dual-core processors scratching $100 mark
- Boxing Comics: Girls, Zombies, and X-23
- Excite Truck vs MotorStorm
- Pro Printer Titans Clash in Vegas
- Top 10 Movie Fights
- Size, Style and Sound
-
Registry Cleaner
-
basic pack
-
Registry
-
hp basic starter camera driver
-
monitor with tv tuner
-
p5b e with e6600
-
does xp work with i7
-
from russia with hate
-
questions on ratio with answers
-
PDA with USB host
-
pc won t boot with 3cr990
-
Help with Graphics Card
-
installing a sata hdd with a
-
GE VoIP Webcam with Ear Clips
-
Will a PCIe x16 slot with