Solved

Looking for a wmi script to run a vbs script remotely

Posted on 2011-03-21
1
314 Views
Last Modified: 2012-05-11
Looking for a wmi script to run a vbs script remotely. For example we create a vbs script that creates a word document then edit it and saves it. If possible would like to see run on remote machine. Purpose of this script is to monitor virtual desktop environments.
0
Comment
Question by:williamfl
1 Comment
 
LVL 4

Accepted Solution

by:
Tuyau2poil earned 500 total points
ID: 35184577

You can try this (may need impersonation) :

set objWMIService = getobject("winmgmts://" & strComputer & "/root/cimv2")

' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")

Set objProgram = objProcess.Methods_("Create").InParameters.SpawnInstance_

objProgram.CommandLine = "cscript.exe myapp.vbs"

'Execute the program
Set strShell = objWMIService.ExecMethod( "Win32_Process", "Create", objProgram)


you can also use psexec utility. have a look to this page : http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_22932472.html



0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now