none
Restricting the VB script / windows scripting host on Windows 2008R2? RRS feed

  • Question

  • My question is:

    is it possible to constrain which VB statement could be executed or not - e.g. by GPO or some registry tweaks?

    Are there other possibilities to restrict what VB can do on behalf of the users?

    Some details:

    we make a CAE application (a mix of C#/.net, C++2010 and VB6) that has internally heavy usage of VB and VBScript at many places.

    In one of our customer's installations we see that some script functions don't work properly or variables suddenly go read-only.

    A simple script like 

    x=200

    x=x/2 

    threw an exception in the second line (variable is read only)  and the script debugger tells us x still contains the value 200 

    But by default a varialbe is of type "variant" if not declared otherwise  with DIM or such things.

    Another situation is that some functions seem to depend on the MS Script debugger... they return "nothing" if the script debugger is NOT installed and they return values when it is present.

    A third one has special OLE-dependent function shows a picture after it jumped into the debugger first with a strange exception... when I klick on the continue button the image is loaded, when I disable the script debugging the place for the image is empty without any error message.

    And finally in one environment I noticed that the ShellExecute doesn't execute at all.

    I need some hints for making a test tool - so I can finally the IT people tell what to change. The customer has a strange IT provider, and we need to prove that his environment is modified or customized... becuase on an OOB installation with MSDN installation media these problems are not repeoducible.




    • Edited by Al Hasoob Friday, July 24, 2015 11:23 AM forgot sumthink
    Friday, July 24, 2015 11:19 AM

All replies

  • VBScript has a property UseSafeSubset. But x = x/2 should always work for a value of 200 no matter what.

    The script debugger installed or not should be irelevent.

    Anyway try doing a Vartype on x and see what datatype is in the variant (might be an object with a default property with a value of 200)

    All up this seems a hosed system. I'd try repairing vbscript (uninstall the last vbscript update and reinstall it), vb6 (uninstall/install service pack 6), and VBA (just use Office's Detect and Repair feature).

    And turn off all security (unplug the network cable). Also try safe mode. (don't rule out either a virus or antivirus)


    David Candy

    Friday, July 24, 2015 10:40 PM
  • ok thanks for the suggestions... repair of VB will be the first step.
    Thursday, August 6, 2015 3:12 PM