Discussion:
Using SECEDIT /configure
(too old to reply)
uedb5254
2005-07-08 17:49:18 UTC
Permalink
When executing a 'secedit /configure 'command with a '/overwrite' option
inside a vbscript, the script hangs because its waiting for a "y" or "n"
response.

Is there a way to repond with a "y" dynamically wiithout hanging the vbscript?
Torgeir Bakken (MVP)
2005-07-08 18:23:38 UTC
Permalink
Post by uedb5254
When executing a 'secedit /configure 'command with a
'/overwrite' option inside a vbscript, the script hangs
because its waiting for a "y" or "n" response.
Is there a way to repond with a "y" dynamically wiithout
hanging the vbscript?
Hi,

I think this should work:

Use cmd.exe /c (%comspec% /c) and pipe y into the secedit command
using echo y|


Example:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

sCmd = "%comspec% /c echo y|secedit.exe /configure ..."

oShell.Run sCmd, 0, True

'--------------------8<----------------------
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Ato Bisda
2005-07-08 18:33:08 UTC
Permalink
Hello,

I got around this problem by putting the "Y" answer in a text file called YES.TXT
and piping it into the SECEDIT command as in the following example:

SECEDIT /CONFIGURE /DB security.db /CFG security.inf /OVERWRITE <YES.TXT

Regards,
Ato
Post by uedb5254
When executing a 'secedit /configure 'command with a '/overwrite' option
inside a vbscript, the script hangs because its waiting for a "y" or "n"
response.
Is there a way to repond with a "y" dynamically wiithout hanging the vbscript?
B-Mann
2005-07-08 23:13:05 UTC
Permalink
Post by uedb5254
When executing a 'secedit /configure 'command with a '/overwrite' option
inside a vbscript, the script hangs because its waiting for a "y" or "n"
response.
Is there a way to repond with a "y" dynamically wiithout hanging the vbscript?
I have been using the following for sometime now under Windows 2000. There
is a /quiet switch that will suppress the prompts.

strcmd = "secedit /configure /db pol.sdb /cfg pol.inf /log pol.log /quiet"
WSHShell.Run strcmd , 0, True

B-Mann
Ato Bisda
2005-07-09 01:31:28 UTC
Permalink
Hello,

I don't think the "/quiet" switch will suppress the prompt resulting from the "/overwrite" switch
(at least it doesn't do it for the Win2K machines I work with).

Regards,
Ato
Post by B-Mann
Post by uedb5254
When executing a 'secedit /configure 'command with a '/overwrite' option
inside a vbscript, the script hangs because its waiting for a "y" or "n"
response.
Is there a way to repond with a "y" dynamically wiithout hanging the vbscript?
I have been using the following for sometime now under Windows 2000. There
is a /quiet switch that will suppress the prompts.
strcmd = "secedit /configure /db pol.sdb /cfg pol.inf /log pol.log /quiet"
WSHShell.Run strcmd , 0, True
B-Mann
Loading...