Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-22
2
Medium Priority
?
6,211 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
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 2000 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

877 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