Solved

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

Posted on 2004-04-22
2
6,190 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 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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