?
Solved

Changing "My Documents" Location

Posted on 2005-05-03
10
Medium Priority
?
1,150 Views
Last Modified: 2013-11-20
Is it possible?
My G/F is making a little front end bit for the open access machines that 'logs in' a user (not really). It just changes the "My Documents" path, by adding a sub folder to it.

Well she changes the reg keys for Word, and Excel... etc... from: (P = My Documents)

P:/  to  P:/JohnBlogs
But it only works on those specific things.
We need it more global!

So the question: Is there a hack to make Windows use a subfolder of 'My Documents'... *AS* the root of 'My Documents'?
0
Comment
Question by:Lab_Rat
  • 5
  • 3
  • 2
10 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 13920143
I'm not sure how that is related to MFC, but you'd change the value of 'Personal' under 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'
0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 13920177
Eeek, checked it out...

'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' = c:/

Yet the 'My Docs' folder is P:/ (A network folder)!!! When you look at it's propertise on the desktop.

Most amazingly awesome.

What does that mean?
0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 13920258
Ah... after testing....

Opening Word changes the key back to what it was!
Er, Explorer ignores it.

Evil Windows.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 86

Expert Comment

by:jkr
ID: 13920398
You should log out and back in again. Apart from using the registry directly, TweakUI from MS (http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx) can change that.
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 13924842
You can change it by right clicking the My Documents folder on the desktop and setting the path there or else changing the following registry key

'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal

0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 13940628
"You can change it by right clicking the My Documents folder on the desktop and setting the path there"

Hm, not good if your using VC 6++ in VisualStudio. =S

The logging out and in option again...not good.

The key question is, how does the code for right clicking on My Documents do what it does, it's more than just changing the single registry key... some apps don't appear to recognise the change.
0
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 13943699
It looks like this is a bit more complicated and not really provided for in published API'

There is an undocumented api in SHELL32.DLL SHSetFolderPath and you access it with its ordinal (231 or 232)

See
http://groups.google.co.za/group/microsoft.public.vb.winapi/browse_thread/thread/3218bbe33a93d008/e17eb6d817cee67a?q=%22My+Documents%22+SHSetFolderPath&rnum=2&hl=en#e17eb6d817cee67a

However I could not get this to work.

Another brute force solution is to kill explorer and have it restart - not a great solution.

Seems the guys at MS did not want this functionality to be generally availalble
0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 13950579
julianH, thanks... that's what we both got after reseqarch too...SHSetFolderPath has about only 16 links in google!!!
0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 13950583
Seems MS don't publish the shell32.dll API anywere no more... Visual C++ Windows Shell Programming by Dino Esposito, Wrox Press 1998 costs £170 second hand as it's not printed anymore.
Though there's a PDF kicking around.
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 13951066
you are welcome - thanks for the points
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question