|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to print to command prompt instead of pop-up window
Hi all,
Can any one help me with the below code. I want the output to be printed to the command prompt instead of poping up in a window. ==================================== dsRoot = "WinNT://RAC_MASTER/MUNAWAA" set wshShell = Wscript.CreateObject("Wscript.Shell") set dsObj = GetObject(dsRoot) For Each Prop In dsobj.groups wshshell.popup Prop.Name Next 'Prop ======================================== Show quote
"Afsal" <afsal@AVIVA> wrote in message Replace "wshshell.popup" with "Wscript.Echo" (No need for Wscript.Shell news:0F09EF87-BAF2-4AB8-A25A-B961AF5D18C7@microsoft.com... > Hi all, > > Can any one help me with the below code. I want the output to be > printed to the command prompt instead of poping up in a window. > > ==================================== > dsRoot = "WinNT://RAC_MASTER/MUNAWAA" > set wshShell = Wscript.CreateObject("Wscript.Shell") > set dsObj = GetObject(dsRoot) > For Each Prop In dsobj.groups > wshshell.popup Prop.Name > Next 'Prop > ======================================== > > object). For example: ========== dsRoot = "WinNT://RAC_MASTER/MUNAWAA" set dsObj = GetObject(dsRoot) For Each Prop In dsobj.groups Wscript.Echo Prop.Name Next ========= On Oct 29, 1:07 am, Afsal <afsal@AVIVA> wrote:
> Hi all, Assuming you are running the script from the command prompt, using the> > Can any one help me with the below code. I want the output to be > printed to the command prompt instead of poping up in a window. > > ==================================== > dsRoot = "WinNT://RAC_MASTER/MUNAWAA" > set wshShell = Wscript.CreateObject("Wscript.Shell") > set dsObj = GetObject(dsRoot) > For Each Prop In dsobj.groups > wshshell.popup Prop.Name > Next 'Prop > ======================================== cscript.exe host, siply replace wshshell.popup with wscript.echo (you will no longer need to instantiate the wshshell object for this purpose, but it will cause no harm). Tom Lavedas =========== http://members.cox.net/tglbatch/wsh/ |
|||||||||||||||||||||||