Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:59:39+00:00 2026-05-26T17:59:39+00:00

I am developing a commercial VB.net WPF application that needs user generated scripts for

  • 0

I am developing a commercial VB.net WPF application that needs user generated scripts for controlling the application to be shared between users. The best way that I have come across of accomplishing this so far without writing my own parser is using the Microsoft Script Control.

It would appear that both VBScripts and JScripts run through this control have access to wscript and as a result are too powerful to be shared between programmers and non-technical users for obvious security reasons.

I have considered trying to filter out dangerous scripts with some kind of regex parsing or something but that just seems far too risky and easy to circumvent.

So, is there some way of using this control but blocking its access to the system so that it could be used for controlling only the objects that I give it? If not, could someone recommend a better way of doing this?

I do not particularly mind what language the script would be in at this stage, although having multiple options would be nice.

EDIT: I am basing my conclusion that the control is too powerful for this on the fact that the following JScript code successfully launches notepad when called using the .AddCode and .Run methods of the control.

function test(){
    var shell = new ActiveXObject("WScript.shell");
    shell.run("notepad.exe", 1);
}

Thanks for all the help,
Sam.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:59:39+00:00Added an answer on May 26, 2026 at 5:59 pm

    If you just need to kill the ActiveXObject feature which is the entry point to the system, you can silently append some lines to the code you give to the Script Control, like this for example:

    ActiveXObject = null; // add this silently
    
    function test(){
        var shell = new ActiveXObject("WScript.shell"); // this will now fail
        shell.run("notepad.exe", 1);
    }
    

    Of course, if you still need to give some functions to your users, you will then need to propose some sort of an API, use the AddObject function (see How To Use the AddObject Method of the Script Control), and the user would use it like this:

    ActiveXObject = null; // add this silently
    
    function test(){
       // this is a controlled method, because I have added a MyAPI named object
       // using AddObject, and this object has a OpenNotepad method.
       MyAPI.OpenNotepad();
    }
    

    PS: WScript is a, ActiveX Scripting host, so it’s not accessible from the Script Control.

    PS2: This hack does not work in every Script Control underlying languages. It works in JavaScript, but not in VBScript for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a C#/.NET application (Winforms/WPF, not entirely decided yet) which needs to display
Developing a .NET WinForms application: how can I check if the window is in
Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart
When developing a desktop application in .NET, is it possible to not require the
I am developing a commercial MVC2 app that requires a grid that has callback
I was thinking about developing an app that enables the user to remotely check
I'm developing a multi-user application which uses a (postgresql-)database to store its data. I
I'm developing a commercial Windows 7 desktop application (somewhat shrink wrap, but not quite).
I am looking into developing a commercial application using PHP. Since I have experience
I am developing a large commercial program and keep confusing myself between what kind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.