Compare Registry string problem

T

Tim

Hi folks,

I use the following code to create the registry string with no value:

Dim objRegistry

Set objRegistry = GetObject("winmgmts://./root/default:StdRegProv")

objRegistry.SetStringValue HKEY_CURRENT_USER, "Software\Microsoft\VBA", _
"c:\temp\abc.exe", ""

Sometime the code worked fine but sometime it created some code like
"ajdlka".

I would like to create a code to compare registry string name to
"c:\temp\abc.exe". If it does not exist, then wait a second and create the
string again and then compare to "c:\temp\abc.exe". Loop the whole process
until the string name exist.

Could anyone show me the code? Any help will be appreciated.

Thanks in advance.

Tim.
 

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