Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
01-06-2012, 02:48 AM #1
- Join Date
- Dec 2010
- Thanked 0 Times in 0 Posts
[ask] running/closing app using vbscript?
hi .....I want running dekstop application/program or closing application using vbscript via web browser but I don't know how to do it...can anyone help me ?
I got these scripts while I browsing but doesn't work....
<html> <head> <script type="text/vbscript"> Sub Run(ByVal sFile) Dim shell Set shell = CreateObject("WScript.Shell") shell.Run Chr(34) & sFile & Chr(34), 1, false Set shell = Nothing End Sub Run "c:\duel.exe" </script> </head> <body> </body> </html>
Set objShell = CreateObject("WScript.Shell") Set objWmi = GetObject("winmgmts:") strWmiq = "select * from Win32_Process where name='duel.exe'" Set objQResult = objWmi.Execquery(strWmiq) For Each objProcess In objQResult intRet = objProcess.Terminate(1) Next