Search code examples
dlljscript

How to load DLL file from Jscript file?


So I'm writing a standalone JScript file to be executed by Windows Script Host (this file is not going to be used as a web application).

My goal is to load a dll file. Just like using LoadLibrary function in a C++ application.

I tried researching the subject but I didn't come up with anything useful. I'm so lost I don't have any piece of code to share. I understand using ActiveXObject may come to my rescue. if so, any idea how to use it?

Update:

If we all agree that loading is impossible, I'll settle for validity check. Meaning, don't try to load but check if it is loaded and functional.


Solution

  • You can export a specific function for this purpose. Then, from your JScript, execute rundll32.exe and check that the function ran as expected.