Solved

Available Parameters - objShell.Run /C? 1? True?

Posted on 2004-04-22
2
6,206 Views
Last Modified: 2013-12-03
Hi, I am using a WMI script to rename/IP machines per their mac address -- when that is done I am using the following to call a command that joins to the domain and performs some other things.  I just want to see if someone can clarify the syntax for me and provide other available options you can use.  Basically -  I want the script to run the command, wait while it executes, then close all windows.  Here is the code I am using.

set objWMIService = GetObject("winmgmts://" & Computer)
set objShell = WScript.CreateObject("WScript.Shell")
  objShell.Run"cmd.exe /C test.bat", 1, TRUE

I assume the /C will close the window -- but not sure
Note sure what ,1, TRUE do

Any clarification and extra info would be greatly appreciated!
0
Comment
Question by:jkrech17
[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
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 500 total points
ID: 10897080
Hi jkrech17,

with /c you are right: it stops the command processor when finished.

For the parameters to the Run method see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthrun.asp
0
 

Author Comment

by:jkrech17
ID: 10897095
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

630 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