Solved

Looking for a wmi script to run a vbs script remotely

Posted on 2011-03-21
1
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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