Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > WshShell.Exec output read impossible until command finished

Reply
Thread Tools Display Modes

WshShell.Exec output read impossible until command finished

 
 
V Poirot
Guest
Posts: n/a

 
      06-21-2009
Hi

I've done a script to force remove of old DCs.
I'm using NTDSUTIL command line tool for that, and it's working like I
want, except under Windows 2008 (DC)!

I'm unable to read output until command (ntdsutil) has exited. But it's not
what I want, because other inputs depends on previous output.

Question: How can I have a live output read (like under Windows 2003 DC)?
or is their another way to force DC removal (by scripting)?

Here is a sample of my script:

Set WshShell = CreateObject("WScript.Shell")
strCmd = "cmd /c ntdsutil ""popups off"" ""me c"" co ""co to se %
computername%"" q ""se op ta"" ""list sites"""
Set oExec = WshShell.Exec(strCmd)
tmpline = ""
While Not oExec.StdOut.AtEndOfStream
tmpline = LCase(oExec.StdOut.ReadLine)

....
....
' some output analyse...
' and sometimes, I've to send new command, like this one:

oExec.stdIn.WriteLine "select site " & siteSelection

....
....

WEnd


Thanks for your help
Vincent
[FR]

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
impossible to read media files from IE^ Jeje Windows Vista General Discussion 0 07-09-2007 11:09 PM
WshShell.Exec Simone Chemelli Scripting 5 04-22-2005 03:25 PM
0xC00D11BA : impossible to read the file soad Windows Media Player 1 10-17-2004 06:50 PM
WshShell.RegRead Fails to read VGK Scripting 1 10-05-2004 10:59 AM
RE: WSHShell.Exec stops after 9kb data in StdOut ? MFor Scripting 1 09-13-2004 11:27 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59