Move "My Documents" to another directory by modifying Registry,but it does NOT take effect immediat

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

Hi all,

I write a program to move "My Document" to another directory,
modifying the Registry Key about it.

("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell
Folders");
("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders");
("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DocFolderPaths");

and I call RegFlushKey before RegCloseKey. The keys are all changed, but
When I double click the icon on my desktop, it opens the old one.

Is there any other things I should do?
 
Hi,

Registry hacks do not take effect immediately. You have to restart the
computer first.

Of course I cannot comment on the Reg modification itself. I am not sure if
it should be done in HKLM or in HKCU for one user only.

If you have chosen to do the move "the hard way" by means of a Registry hack
just in order to become better acquainted with the Registry, why not try to
do the move the way it is usually done (right-click My Documents - Properties
- Target Tab - Move) and compare registry keys and values before and after
the move.
 
I have the RegMon to monitor the processes accessing Registry.
and I only find the 3 keys I mentioned below. It doesn't take effect
imediately. Is there any trick here?
 
In said:
I have the RegMon to monitor the processes accessing Registry.
and I only find the 3 keys I mentioned below. It doesn't take
effect imediately. Is there any trick here?

If per-user (HKCU), logoff and logon.
 
But if I right-click on My Document icon, select Property, Move,
when finishing , it takes effect right now. I am wondering if
there is any way to accomplish without re-logon.
 
In said:
But if I right-click on My Document icon, select Property, Move,
when finishing , it takes effect right now. I am wondering if
there is any way to accomplish without re-logon.

You could *try* killing and restarting the explorer.exe shell.
Not certain that will do it though. There are also some utilities
that can update user/system settings on demand... I'll see if I can
find the one I am thinking of.

Or try
%systemroot%\System32\rundll32 %systemroot%\System32\user32.dll,UpdatePerUserSystemParameters
....perhaps that will work. I do not know for sure.


But really, use 1 Admin account to "fix" all the other accounts,
reboot, then another Admin account to fix" the first one would be
my method. And only after a Full Registry Backup and files backups FWIW.
 
I tried rundll32 user32.dll,UpdatePerUserSystemParameter,
but it didn't help. Thanks any way.
Actually,I dont wanna reboot,because my program is
a plug-and-play one.

Killing the process explorer.exe is not a good way
I think.
I am run out...
 
Back
Top