Manually Opening the "My Documents Properties" Dialog Box

1

1

In WinXP SP3, Is it possible to open the "My Documents Properties" dialog box from the command line? The dialog box I am referring to is the dialog box then opens when you right click on the "My Documents" folder and open the properties.

I have searched for a means of doing this without success. This file: %windir%\system32\mydocs.dll contains the dialog box, but I cannot figure out how to load it from the command line.

the3seashells

Posted 2009-10-12T18:47:55.173

Reputation: 97

Answers

1

Providing you have a "My Documents" icon displayed on the Desktop, this AutoIt script should do the trick:

WinActivate("[CLASS:Progman]", "")
Send("My Documents")
Send("+{F10}")
Send("{UP}")
Send("{ENTER}")

First, it selects the desktop, then it selects the "My Documents" icon. It sends SHIFT-F10, the shortcut for "right-click". The UP key will select the last item of the menu ("Properties" item for "My Documents") and press ENTER to open it.

Tested it on Windows 7 RTM English, except that I replaced "My Documents" with "Recycle Bin" for testing, as there is no "My Documents" in Windows 7. I have no XP to test this unfortunately. I'm not 100% sure about the "CLASS:Progman" entry, although this is old legacy and should be the same for XP.

Snark

Posted 2009-10-12T18:47:55.173

Reputation: 30 147

Not everyone has the icon on the desktop though :\ – John T – 2009-10-12T19:34:34.220

I know, no idea is this is a possible requirement or if one must find a way that does not require the "My Documents" icon on the Desktop... – Snark – 2009-10-12T19:40:00.980

If need be, I can write a AutoHotKey script that opens the Start Menu and send the keystrokes to open the "My Documents Properties" that way, but I was hoping to find a way to manually open the box. – the3seashells – 2009-10-12T20:24:56.973

0

I just tested rundll32 on that path you provided and I had no luck.

I do not think you can do this from the command prompt. If you say what it is you are trying to achieve, I or someone else may be able to recommend an alternative way of doing it (through registry keys, or other commands etc.)

William Hilsum

Posted 2009-10-12T18:47:55.173

Reputation: 111 572

My goal is to change the folder associated with the "My Documents" folder to a different folder, but without moving files. By default "My Documents" point to C:\Documents and Settings\USER NAME\My Documents, but I want to reassign "My Documents" to a flash drive.

I have seen registry entries, but those require a reboot whereas using the built in "Move" from the dialog box works instantaneously. – the3seashells – 2009-10-12T18:56:37.353

0

Reading your comment on Wil's solution, you can move the target of My Documents like so:

  • Right-click My Documents and go to properties:

    alt text

  • Click "Move" and select the new location to store documents:

    alt text

  • Apply & OK

John T

Posted 2009-10-12T18:47:55.173

Reputation: 149 037

Thank you for the thorough reply. I understand how to move the destination of the folder, what I am trying to figure out is how automate the "Right-click My Documents and go to properties" step. I am attempting to get that dialog to display from the command line / run prompt. – the3seashells – 2009-10-12T19:08:22.900

When you click on Apply, an message will pop up asking you if you want to move the present files to the new location. Just say "No". – Ganesh R. – 2009-10-12T19:09:34.893

Regarding a reboot in-case of registry entries, I think the reboot is required for the explorer to get the new values. Did you try do the registry entries -> crash explorer -> start explorer. Just a thought. – Ganesh R. – 2009-10-12T19:11:54.593

0

So far, I haven't been able to find a method for automating this task. As a guide to what I've been looking towards, to possibly help you on your search, the following command at a command prompt will open My Documents:

explorer.exe ::{450D8FBA-AD25-11D0-98A8-0800361B1103}

The path here is the CLSID, and a list of such IDs can be viewed here. Given this information, if you can find how the CLSID is referenced, you may be able to change it this way.

If you already have a registry method for changing the folder that requires a reboot, you should be able to restart explorer programmatically in order to have the same effect:

taskkill /F /IM explorer.exe
explorer.exe

Will Eddins

Posted 2009-10-12T18:47:55.173

Reputation: 3 354

0

I don't know how to do a perl -e '...' with VBScript, (and no guarantees on style or idiom with the following) but you can invoke this script from the commandline:

set shell = CreateObject("Wscript.Shell")
set app = CreateObject("Shell.Application")
app.namespace(0).parsename(shell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell 

Folders\Personal")).invokeVerb("P&roperties")
MsgBox("Click OK")

The final MsgBox() keeps the script from immediately exiting and (!) killing the properties window.

ayrnieu

Posted 2009-10-12T18:47:55.173

Reputation: 279

Thank you for taking the time to write this. This solutions gets very close, but rather than open the custom "My Documents Properties" window (see John T's screen shot below), it only opens the standard folder properties window. – the3seashells – 2009-10-12T20:21:18.090

0

Looking at the answers and your comments, did you know that you can just drag your folder from the old location to the new? No dialog boxes popping up or anything and Windows will automatically remap all of the required paths for your user profile to point to the new location. (In XP that'd be the My Documents, My Pictures, and My Music folders).

Also, looking at the exports for mydocs.dll, it looks to be a COM DLL with no visible entry points for you to use with rundll32. Of course, I could be wrong about that.

Joshua

Posted 2009-10-12T18:47:55.173

Reputation: 4 434