Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Aug 2nd, 2006, 12:40 PM   #1
randum77
Programmer
 
randum77's Avatar
 
Join Date: Jun 2006
Location: Fayettehell, NC
Posts: 56
Rep Power: 3 randum77 is on a distinguished road
There has got to be a better way.....

Ok, presently this is the method I use for running an external *.exe from within a vbscript.

strComputer = "."
	Hidden_Window=5
	Set objWMIService = GetObject ("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	set objStartup = objWMIService.Get("Win32_ProcessStartup") 
	Set objConfig = objStartup.SpawnInstance_ 
	objConfig.ShowWindow = Hidden_Window
	Set objProcess = GetObject ("winmgmts:root\cimv2:Win32_Process")
	errReturn = objProcess.Create("D:\ISRA\COSS\Filewatch.exe", null, objConfig, intProcessID)

Is there a better way to run an external *.exe from within a VBScript? I need to run it, then kill it. I search for a bit but couldn't find anything useable. Thanks in advanced.
__________________
_Marshall_

"America has bred a society that is innocent and incapable of accepting responsibility, but yet, is able to place blame on others without guilt."
randum77 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC