WshShell.Exec output read impossible until command finished
Tech-Archive recommends: Fix windows errors by optimizing your registry
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]
.
Relevant Pages
- Re: batch file to delete files based on criteria
... The Advanced Version of Snapshot will create date/time coded backups that ... This script is included with the FREE Advanced NT/2K/XP/K3 Command Library ... script will perform CONSISTENTLY under Windows NT4, 2000, XP and Server ... (microsoft.public.win2000.cmdprompt.admin) - Re: WshShell.Exec output read impossible until command finished
... I've done a script to force remove of old DCs. ... I'm using NTDSUTIL command line tool for that, ... How can I have a live output read (like under Windows 2003 DC)? ... (microsoft.public.scripting.vbscript) - Re: Swap/Remap Ctrl and Alt keys.......Finally
... startup/login script. ... It shows a message saying you need to add a line to a login script to ... The back quotes mean that the output of the "uname -n" command shall be ... options are much more comprehensive that those in Windows (does Windows ... (Ubuntu) - Re: Windows 2000 remote login problems
... Whenever a user forgets their Windows password we ... When the user forgets his password, he logs on with the user Setpassword. ... and the script asks for the user name to reset as well as the ... Changing password from a script (vbscript as well as command line): ... (microsoft.public.win2000.security) - WshShell.Exec output read impossible until command finished
... I've done a script to force remove of old DCs. ... I'm using NTDSUTIL command line tool for that, ... How can I have a live output read (like under Windows 2003 DC)? ... (microsoft.public.scripting.vbscript) |
|