Sign in to follow this  
Followers 0
dazco

how to open a folder

9 posts in this topic

#1 ·  Posted (edited)

I just want a script to open a folder, so i need to know the simple syntax to do that. We'll say the folder is at c:\audio. What would i type?

Thanks......

Edited by dazco

Share this post


Link to post
Share on other sites



Thank you !

Share this post


Link to post
Share on other sites

Downloaded AutoIt today and spent the past hour trying to do something like that

Basically I want My Documents (the proper Shell one, not C:/Documents and Settings/User/My Documents), to open in a normal directory window, but I can't figure out how thats done. The best I've got to is:

Run("explorer.exe")

WinWaitActive("My Documents")

ControlClick ( "My Documents", "", "ToolbarWindow323")

Notes:

-When I run Explorer it starts at My Documents Folder, so no need to specify directory

-ToolbarWindow323 is the Classname of the 'X' which closes folder view.

So I end up with a window looking pretty similar to the standard directory (not Explorer) window.

JdeB, if you want explorer to start with folder view hidden:

run,explorer.exe c:\audio

WinWaitActive("audio")

ControlClick ( "audio", "", "ToolbarWindow323")

If anyone has a simpler, more efficient method please share!

Share this post


Link to post
Share on other sites

Basically I want My Documents (the proper Shell one, not C:/Documents and Settings/User/My Documents), to open in a normal directory window, but I can't figure out how thats done.

This code will open the desired directory within a seperate Window without the folder list pane:

Run(@WindowsDir & "\explorer.exe /root, " & Chr(34) & @MyDocumentsDir & Chr(34))

This code does the same as above, but also includes the folder list pane:

Run(@WindowsDir & "\explorer.exe /e,/root,::{20D04FE0-3AEA-1069-A2D8-08002B30309D} " & Chr(34) & @MyDocumentsDir & Chr(34))

Hope this is what you were asking for...

Share this post


Link to post
Share on other sites

Run("explorer.exe /n,/root,::{450D8FBA-AD25-11D0-98A8-0800361B1103}")

That will open explorer in a new single pane to the My Documents directory.

Share this post


Link to post
Share on other sites

Thanks Guys, all your suggestions do indeed open the my documents folder, but they open the actual folder itself, not the Shell 'My Documents' Folder. The result is that the Icon layout is different, than the one I want.

If you have no idea what I'm talking about try this. Assuming you have the My Documents icon on your desktop, double click it. Now, remove 'auto-arrange' and juggle the icons about. Now close the window. Open a new explorer window and browse to C:\Documents and Settings\[Your Username]\My Documents, and notice that the icons are not in the 'juggled about' state that you left them, but if you open the My Documents shortcut on your desktop, they are. So Windows stores two different view settings for the C:\Documents and Settings\Matthew\My Documents, and the 'shell' My Documents which you reach via the desktop. This shell My Documents folder is also accessible in explorer by opening folder view and then selecting the My Documents entry Directly under the Desktop root. It's this shell 'My Documents' that I am trying to open with the script, and the only way I have found (albeit a rather inefficient one) is the code I pasted above.

Share this post


Link to post
Share on other sites

Thanks Guys, all your suggestions do indeed open the my documents folder, but they open the actual folder itself, not the Shell 'My Documents' Folder. The result is that the Icon layout is different, than the one I want.

If you have no idea what I'm talking about try this. Assuming you have the My Documents icon on your desktop, double click it. Now, remove 'auto-arrange' and juggle the icons about. Now close the window. Open a new explorer window and browse to C:\Documents and Settings\[Your Username]\My Documents, and notice that the icons are not in the 'juggled about' state that you left them, but if you open the My Documents shortcut on your desktop, they are. So Windows stores two different view settings for the C:\Documents and Settings\Matthew\My Documents, and the 'shell' My Documents which you reach via the desktop. This shell My Documents folder is also accessible in explorer by opening folder view and then selecting the My Documents entry Directly under the Desktop root. It's this shell 'My Documents' that I am trying to open with the script, and the only way I have found (albeit a rather inefficient one) is the code I pasted above.

Not to be nosy, but what are you doing that its so critical you must have that version of the folder opened? There may be other ways to do whatever it is you are trying to achieve.

Share this post


Link to post
Share on other sites

Ok I got it! :whistle:

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

It's looking very similar to Valik's but when I tried his I got the wrong icon layout as I explained earlier. I know I shouldn't be so happy about something so geeky but I am! I think I will change my nick to UBERGeeK.. is that possible? B) lol

It was such a pain to find that stupid CLSID, when all the time it was on this board :angry:, although the way I found it might amuse you. I put the pointer over the desktop shortcut to My Documents, saw the tool tip, did a search for it in the registry, that gave me the SHELL32.DLL line which it referred to, so i did another reigistry search for that line, and found the corresponding CLSID. The is the magic formula to find any other CLSID (although, for the record i noticed a whole list of them in the AutoIt Help - Yes I know.. i'm stupid not to have seen it before :evil:

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0