[AccessD] VB Scripts

MartyConnelly martyconnelly at shaw.ca
Tue Jan 17 16:11:54 CST 2006


Well with Win 2000 + you get vbscript.dll with the OS.
You can rewrite necessary vbs script files to run from Access VBA
I do this for WMI vbs script files

Included the following code in your Login Script:
It still allows legitimate need for executing VBScript files by
right-clicking and selecting Open.


Sub DisableVBScript()
' Make Default Action of .VBS and .VBE files "Edit" instead of "Open"
' This will cause the script file to open in notepad when double-clicked
instead of running.


    On Error Resume Next


    Dim WshShell
    Set WshShell = WScript.CreateObject("WScript.Shell")


 WshShell.RegWrite "HKCR\VBSFile\Shell\", "Edit"
 WshShell.RegWrite "HKCR\VBEFile\Shell\", "Edit"

'Instead of the above .RegWrite  use the following:


'    WshShell.RegDelete "HKCR\.vbs\"
'    WshShell.RegDelete "HKCR\.vbe\"

'This will remove the extensions from the registry.  This is more
'drastic, but may be better for some organizations.
'I wont allow vbs files to be executed at all.

End Sub

The above code is similar to doing the following excerise
------------------------
WSH is installed by default.
To prevent scripts with a .VBS extension from being run:
without running code

Log on as an Administrator.
On the 'Desktop', or in 'Windows Explorer', right-click on
'My Computer'. Select 'Open' from the menu.
In the 'My Computer' window, open the 'Tools' menu
and select 'Folder Options'. Open the 'File Types'
tabbed page.


Look for 'VBScript Script File' in the list of file types
(if you can't find it, your machine is safe and you don't
need to do anything else). Click on the 'Delete' button.
If you see a dialog asking you to confirm removal, click
'Yes'.
-----------


There are ways via Tools -- Options to indivually disallow vbscript from 
running
in programs like IE and Outlook

The most drastic way to disable scripting is the following deregister 
commands
be advised, some features of the OS may depend on these DLL's being
registered.

Start, Run and enter
REGSVR32  - U  VBSCRIPT.DLL
REGSVR32  -U   JSCRIPT.DLL
 





Jim Lawrence wrote:

>Hi All:
>
>Here is a simple question. 
>
>Does MS require MS Office products to be able to run VB Scripts or VS to be
>able to compile these scripts in order to have them run on a system or is
>the capability just built into any version of Windows? ...like IE.
>
>Can the ability of running of VB scripts be easily turned off and on?
>
>A client is requesting specific details so they can balance security against
>functionality and I just do not know enough about the subject.
>
>MTIA
>Jim  
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list