Search KB Filter article types
Using WScript.shell to interact with the Client machine (by Mark Reed)
Categories: ActiveX, Custom Controls
Tags: Architects, Developers, Wrapper, 2. Intermediate, 3. Advanced, Customization, Integration, ActiveX, Pre v6.3, v6.3
Revision: 1
Posted: 02/Jan/2008
Updated: 02/Jan/2008
Status: Publish
Types: Code

The following sample application shows how to use the "WScript.shell" ActiveX object in order to interact with the client machine and some more.

In the project you will see a custom control named Shell which is represented by a server side cs file and a js client
file.

Within the client js file you will see 4 action methods:

1. Shell_Init - initializes the ActiveX object.
2. Shell_Run - execute an executable on the client machine
3. Shell_PlaySound - play a sound using <Object> tag and an internal media player
(does not use the WScript.shell)
4. Shell_SendKeys - simulate key press.

And 3 post occurrence methods which are invoked in order to raise an event back to the server to enable handling
the action Finish event on server side scripting.

Note: Codes are submitted as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Terms of Agreement:
By using this code, you agree to the following terms...

1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3. You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


About the author

Related Articles

ActiveX  
Title Update Author
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ActiveX, Flash, v6.3, v6.4 and Later
30/Oct/2010    2010/10/30
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ActiveX, Flash, v6.3, v6.4 and Later
13/Nov/2010    2010/11/13
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ActiveX, Flash, v6.3, v6.4 and Later
30/Oct/2010    2010/10/30
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ActiveX, Flash, v6.3, v6.4 and Later
30/Oct/2010    2010/10/30
Tags: Developers, Wrapper, 2. Intermediate, 3. Advanced, Wrapping Controls, ActiveX, v6.4 and Later
23/July/2010    2010/07/23
I played a bit around with the new 6.4 ListView control, its quite amazing what you can do with it. It opens a lot of new ways to present data in a better and more userfriendly way.
Tags: Architects, Developers, Data Binding, C#, 2. Intermediate, 3. Advanced, Customization, Data Binding, v6.4 and Later
05/Jan/2010    2010/01/05
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS