in reply to Refreshing the Windows Registry

Your not supplying much information. What errors do you get, and from which modules/code?

Posting the script in question, if it isn''t too big, would help a lot.

I suspect that you aren't untying the registry, and hence your changes aren' being commited before you try to move on to the second step, but that's a guess.

You might try using the Flush method, though the docs say that it isn't usually necessary.

Flush( $bFlush ) Flushes all cached information about the Registry key so that future u +ses will get fresh data from the Registry. If the optional $bFlush is specified and a true value, then RegFlushKe +y() will be called, which is almost never necessary.

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Timing (and a little luck) are everything!

Replies are listed 'Best First'.
Re^2: Refreshing the Windows Registry (Flush)
by tye (Sage) on Jan 15, 2004 at 20:38 UTC
    I suspect that you aren't untying the registry, and hence your changes aren' being commited

    No, changes are committed when they are made. No need to close or untie or anything.

    You might try using the Flush method, though the docs say that it isn't usually necessary.

    No, the docs say (as you quoted) that "If the optional $bFlush is specified and a true value, then RegFlushKey() will be called, which is almost never necessary." which is not at all the same as saying that Flush() isn't usually necessary.

    Win32::TieRegistry doesn't listen for changes to the registry and fetches all values or subkey names for a key in a single batch. So once you fetch any of a key's contents, the object will only report things that were in that key at the time of that first fetch. To refresh the key's contents you need to Flush() (or destroy the object and get a fresh one).

                    - tye