verify open windows

K

Kevin

Hello folks,

I've developed a program that starts with "Application.Visible = False" then proceeds to execute the regedit application via the shell method <Shell "C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", vbNormalFocus>. It then reboots the PC. Problem is the reboot overrides a necessary prompt/response from the regedit application. That is, I need to respond to two prompts from the regedit application before rebooting the PC. Is there a way I can force the reboot to wait for these prompts and responses?

Thanks.

Kevin
 
K

Kevin

Problem solved

A search of "wait external application" returned the following from Ivan F Moala

This may be of use (Also includes a few other links
http://www.xcelfiles.com/VBA_01.html#anchor_1

Thanks Ivan.

----- Kevin wrote: ----

Hello folks

I've developed a program that starts with "Application.Visible = False" then proceeds to execute the regedit application via the shell method <Shell "C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", vbNormalFocus>. It then reboots the PC. Problem is the reboot overrides a necessary prompt/response from the regedit application. That is, I need to respond to two prompts from the regedit application before rebooting the PC. Is there a way I can force the reboot to wait for these prompts and responses

Thanks

Kevin
 
D

Dave Peterson

You can run regedit in silent mode--to suppress all the messages.

I found this in a google search:
http://www.ntcompatible.com/thread26615-1.html

REGEDIT [/L:system] [/R:user] [/v|-v] [/s|-s] filename1
REGEDIT [/L:system] [/R:user] /C filename2
REGEDIT [/L:system] [/R:user] /E filename3 [regpath]

/L:system
Specifies the location of the System.dat file.

/R:user
Specifies the location of the User.dat file.

[/v|-v]
This switch opens REGEDIT.EXE in advanced mode, where the registration
database is
displayed in a tree structure (similar to the tree window in Windows 3.1 File
Manager).
Any part of the database can be edited.

[/s|-s]
When a filename is specified on the command line, this switch is used to
suppress any
informational dialog boxes that would normally be displayed. This is useful
when the Setup
program for an application wants to execute REGEDIT.EXE with a .REG file, but
does not
want the user to be confused by any dialog boxes that are displayed.

filename1
Specifies the file(s) to import into the registry

/C filename2
Specifies the file to create the registry from.

/E filename3
Specifies the file to export the registry to.

regpath
Specifies the starting registry key to exportfrom. (Defaults to exporting the
entire
registry).

Syntax for Switches Either "/" or "-" can be used to signify the optional
switches. The
switches can be combined (for example, -vs) and be typed in either uppercase
or
lowercase. Unrecognized switches are ignored.
 
K

Kevin

Thanks Dave

I substitute
Shell("REGEDIT /L:C:\WINDOWS\ /R:C:\WINDOWS\ C:\RESTRICT.REG /S", 1
fo
Shell("C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", 1
But it failed to work

Any ideas

Kevi

----- Dave Peterson wrote: ----

You can run regedit in silent mode--to suppress all the messages

I found this in a google search
http://www.ntcompatible.com/thread26615-1.htm

REGEDIT [/L:system] [/R:user] [/v|-v] [/s|-s] filename1
REGEDIT [/L:system] [/R:user] /C filename2
REGEDIT [/L:system] [/R:user] /E filename3 [regpath]

/L:system
Specifies the location of the System.dat file.

/R:user
Specifies the location of the User.dat file.

[/v|-v]
This switch opens REGEDIT.EXE in advanced mode, where the registratio
database i
displayed in a tree structure (similar to the tree window in Windows 3.1 Fil
Manager)
Any part of the database can be edited.

[/s|-s]
When a filename is specified on the command line, this switch is used t
suppress an
informational dialog boxes that would normally be displayed. This is usefu
when the Setu
program for an application wants to execute REGEDIT.EXE with a .REG file, bu
does no
want the user to be confused by any dialog boxes that are displayed.

filename1
Specifies the file(s) to import into the registry

/C filename2
Specifies the file to create the registry from.

/E filename3
Specifies the file to export the registry to.

regpath
Specifies the starting registry key to exportfrom. (Defaults to exporting th
entir
registry).

Syntax for Switches Either "/" or "-" can be used to signify the optiona
switches. Th
switches can be combined (for example, -vs) and be typed in either uppercas
o
lowercase. Unrecognized switches are ignored

Kevin wrote
 
T

Tom Ogilvy

if
Shell("C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", 1)

works, then

Shell("C:\WINDOWS\REGEDIT.EXE /s C:\RESTRICT.REG", 1)

should suppress the dialog.

--
Regards,
Tom Ogilvy

Kevin said:
Thanks Dave.

I substituted
Shell("REGEDIT /L:C:\WINDOWS\ /R:C:\WINDOWS\ C:\RESTRICT.REG /S", 1)
for
Shell("C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", 1)
But it failed to work.

Any ideas?

Kevin

----- Dave Peterson wrote: -----

You can run regedit in silent mode--to suppress all the messages.

I found this in a google search:
http://www.ntcompatible.com/thread26615-1.html

REGEDIT [/L:system] [/R:user] [/v|-v] [/s|-s] filename1
REGEDIT [/L:system] [/R:user] /C filename2
REGEDIT [/L:system] [/R:user] /E filename3 [regpath]

/L:system
Specifies the location of the System.dat file.

/R:user
Specifies the location of the User.dat file.

[/v|-v]
This switch opens REGEDIT.EXE in advanced mode, where the registration
database is
displayed in a tree structure (similar to the tree window in Windows 3.1 File
Manager).
Any part of the database can be edited.

[/s|-s]
When a filename is specified on the command line, this switch is used to
suppress any
informational dialog boxes that would normally be displayed. This is useful
when the Setup
program for an application wants to execute REGEDIT.EXE with a .REG file, but
does not
want the user to be confused by any dialog boxes that are displayed.

filename1
Specifies the file(s) to import into the registry

/C filename2
Specifies the file to create the registry from.

/E filename3
Specifies the file to export the registry to.

regpath
Specifies the starting registry key to exportfrom. (Defaults to exporting the
entire
registry).

Syntax for Switches Either "/" or "-" can be used to signify the optional
switches. The
switches can be combined (for example, -vs) and be typed in either uppercase
or
lowercase. Unrecognized switches are ignored.
False" then proceeds to execute the regedit application via the shell method
<Shell "C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", vbNormalFocus>. It then
reboots the PC. Problem is the reboot overrides a necessary prompt/response
from the regedit application. That is, I need to respond to two prompts
from the regedit application before rebooting the PC. Is there a way I can
force the reboot to wait for these prompts and responses?
 
K

Kevin

It worked like a charm

Thanks again Tom

----- Tom Ogilvy wrote: ----

i
Shell("C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", 1

works, the

Shell("C:\WINDOWS\REGEDIT.EXE /s C:\RESTRICT.REG", 1

should suppress the dialog

--
Regards
Tom Ogilv

Kevin said:
Thanks Dave
I substitute
Shell("REGEDIT /L:C:\WINDOWS\ /R:C:\WINDOWS\ C:\RESTRICT.REG /S", 1
fo
Shell("C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", 1
But it failed to work
Any ideas
Kevi
----- Dave Peterson wrote: ----
You can run regedit in silent mode--to suppress all the messages
I found this in a google search http://www.ntcompatible.com/thread26615-1.htm
REGEDIT [/L:system] [/R:user] [/v|-v] [/s|-s] filename
REGEDIT [/L:system] [/R:user] /C filename
REGEDIT [/L:system] [/R:user] /E filename3 [regpath
Specifies the location of the System.dat file
Specifies the location of the User.dat file
This switch opens REGEDIT.EXE in advanced mode, where th registratio
database i
displayed in a tree structure (similar to the tree window i Windows 3.1 Fil
Manager)
Any part of the database can be edited
When a filename is specified on the command line, this switch i used t
suppress an
informational dialog boxes that would normally be displayed. Thi is usefu
when the Setu
program for an application wants to execute REGEDIT.EXE with a .RE file, bu
does no
want the user to be confused by any dialog boxes that ar displayed
Specifies the file(s) to import into the registr
/C filename
Specifies the file to create the registry from
/E filename
Specifies the file to export the registry to
Specifies the starting registry key to exportfrom. (Defaults t exporting th
entir
registry)
Syntax for Switches Either "/" or "-" can be used to signify th
optiona
switches. Th
switches can be combined (for example, -vs) and be typed in eithe uppercas
o
lowercase. Unrecognized switches are ignored
Kevin wrote
False" then proceeds to execute the regedit application via the shell metho
<Shell "C:\WINDOWS\REGEDIT.EXE C:\RESTRICT.REG", vbNormalFocus>. It the
reboots the PC. Problem is the reboot overrides a necessary prompt/respons
from the regedit application. That is, I need to respond to two prompt
from the regedit application before rebooting the PC. Is there a way I ca
force the reboot to wait for these prompts and responses
 
Top