APEX-AT-WORK no image
Tags:

Run an executable file from your browser

Von Tobias Arnhold 4.23.2010
Internet Explorer is the only browser which can run executable files. I don't know any other browser which supports this feature. Of course there are common reason why! With IE you need to use VBScript. As we all know it is not secure way of developing web application. So be careful in creating security rules inside your Internet Explorer.

This code shows two examples:

<HTML>
<HEAD>
</HEAD>
<BODY>

<SCRIPT language = "vbscript">
'define application
dim v_prog

'set command
v_prog = "C:\Programme\7-Zip\7zFM.exe"

'create a shell
set v_shell = createobject("wscript.shell")

'run application
v_shell.run(v_prog)
</SCRIPT>

<SCRIPT language = "vbscript">
'set variables
dim v_shell
dim v_return
dim v_prog

'set command
v_prog = "%SystemRoot%\system32\ping 192.168.0.1"

'create a shell
set v_shell = CreateObject("WScript.Shell")

'run application
v_return = v_shell.Run(v_prog,1,TRUE)

'check return value
if v_return = 0 then
MsgBox "Server is up",64,"Server status"
else
MsgBox "Server is down",64,"Server status"
end if
</SCRIPT>

</BODY>
</HTML>


How to: Visual Basic Scripting - http://msdn.microsoft.com/en-us/library/t0aew7h6%28v=VS.85%29.aspx

Post Tags: