install .reg file when db starts

D

DHill009

i have a database running on 2007 runtime.

when the database starts i need it to install a .reg file. this re-writes a
reg key.

also if poss i want to suppress the confirmation boxes.

the .reg file to install is:

c:\Titan\Rereg.reg

any help would be great ;-)
 
D

Douglas J. Steele

Use Shell to run regedit.exe

Untested, but:

Dim strCmd As String

strCmd = "regedit.exe c:\Titan\Rereg.reg"
Shell strCmd
 
D

DHill009

i didnt work....

i get vb error:

runtime error '5'
invalid procedure call or argument.

when i click debug it highlights shell strcmd as a problem

any other idea's....im not very good with vb
 
D

Douglas J. Steele

I just tested, and it works fine for me.

What exactly did you do with the code I suggested?
 
D

David W. Fenton

Use Shell to run regedit.exe

Untested, but:

Dim strCmd As String

strCmd = "regedit.exe c:\Titan\Rereg.reg"
Shell strCmd

Why not just use ShellExecute?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top