Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modify registry from stored proc 1

Status
Not open for further replies.

vadimg

IS-IT--Management
Oct 25, 2001
152
US
Hi.
SQL 2000
Windows Advanced Server

I'm generating a dynamic .reg registry file in a stored procedure, and I want to execute it to add it's contents to the registry. But to execute a .reg file I have to reply to 2 promts:
1. are you sure you want to blah blah - YES
2. registry has been modified blah blah - OK

How can I get around this??
Are there switches i can use in xp_cmdshell?
Can I create a batch file and just execute that?
I know that there are some xp's that deal with the registry (xp_regread), but I cannot find any info on them in BOL or MSDN site.

Any help is greatly appreciated.
 
regedit /s c:\xyz.reg

this will not prompt u anything.
 
THANKS!!!
works like a charm
 
hi,

I tried to create a registry key using the following

REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
"Winpopup"="C:\Windows\Winpopup.exe"

via a batch file at the logon script. but, while testing the .reg file, the key wasn't created!

any idea why?

what i am trying to do is to add winpopup.exe to all win9x clients so that i can use xp_cmdshell to net send messages on SQLServer 2000.
 
I found the way to writing to registry. there must be a line feed after REGEDIT4 and also after the last line of the file.

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
"Winpopup"="C:\Windows\Winpopup.exe"


cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top