Windows shell add item to protected folder {2559a1f2-21d7-11d4-bdaf-00c04f60b9f0} - windows

I want to make a small program that locks folders with password and unlocks with that password again. I can do it with adding some special Class Ids to folder name. (
Also, I want to add this feature to windows right click context menu for folders.(-> Lock & Unlock this folder)
I can add new items to folders via "HKEY_CLASSES_ROOT\Directory\shell" successfully. It seems when a folder is not locked. But after a folder is locked, the item is not seem on right click context. I have tried with several nodes of regedit but no one is succeeded.
How can I add a new item to right click context of all folders (include locked folders)?

You need to register your command in the key for the CLSID you used to "lock" the folder.
If you use the "lock GUID" ({2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}) then you must add your verb under "HKEY_CLASSES_ROOT\CLSID{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}\shell"


Add an item to the Finder/Save dialog sidebar

I'm working on a script where a user logs into a guest account on OS and is prompted for their network credentials in order to mount their network home folder (while they benefit from working on a local user folder).
As the guest folder is deleted when users log out, I want to discourage them from saving anything there. I would like to replace the items on the Finder and Open/Save sidebar lists (such as "Desktop", username, "Documents", etc) with ones that would save into their network home folder.
It is possible to do this using AppleScript or Cocoa APIs, or do I need to modify a plist and restart the Finder? [Ack. Looking into ~/Library/Preferences/, it isn't at all clear how I'd populate it.]
Similar Questions:
AppleScript: adding mounted folder to Finder Sidebar?
suggests using fstab; this code will most likely run as a user and really, automounting at that point would be too late.
How do you programmatically put folder icons on the Finder sidebar, given that you have to use a custom icon for the folder?
Says there is no Cocoa API, but that you can use a carbon-style LSSharedFileList API that is only documented in a single header file.
Does anyone know of some example code to add an item to the Finder sidebar?
It is possible to do this using AppleScript or Cocoa APIs, or do I need to modify a plist and restart the Finder?
As I said on that other question, the correct way to add an item to the sidebar is to use LSSharedFileList.
A co-worker came up with this method that uses applescript:
tell application "Finder"
-- Select the path you want on the sidebar in the Finder
select folder "Preferences" of folder "Library" of (path to home folder)
tell application "System Events"
-- Command-T adds the Documents Folder to the sidebar
keystroke "t" using command down
end tell
end tell

Remove all related mail files within Windows 7

I have windows 8 machine and I will give my pc to company owns it. The thing is I dont want anybody able to see my "old" e-mails. I removed from these e-mails in Outlook but:
when I click windows icon left bottom and type somethings related with a deleted mail, it appears in there..(when I try to open it it propt a msg that it is deleted and ask me to remove shortcut too.)
So I want to delete all these fiels completely and not able to see anything about them it musnt be able to search by somehow..
I dont want anything exist about that files in pc
I click and view properties of that file appears on windows start bar it located in
so I would think to delete this directory but there is also "AppData" file in it which used by other stuff.. I couldnt figure it out how to remove things about only e mails once for all
Close Outlook.
Go into Control Panel, and in the search box at the top choose Mail (or Mail (32-bit)).
Click the Data Files... button, highlight your name in the list, and then click the Open File Location button, which will open Windows Explorer. Leave Explorer open, but close the Data Files dialog.
Click the Show Profiles... button, where you should see Outlook or your profile name. Select it and click Remove.
Close the Mail control panel dialog. Go back to the Explorer window you left open before, and delete the youremail#yourmailhost.ost file, which is all of your email content (inbox, sent, etc.). You may want to delete all of the other files and folders in this folder, as they're all of your Outlook related info (address book, etc.).

Programmatically sort folders on Windows 8

Windows 8 does not seem to persist sort orders on individual folders. I'm guessing when explorer.exe terminates (like when rebooting) these preferences get discarded? Beats me, all I know is after a time (like a few days) those preferences get totally lost.
Is there a way to duplicate programmatically sorting folders in Windows Explorer (opting one of the 'Sort by' options in the context menu)?
Such that, say I have a folder opened in the Windows UI. Say the folder is currently set to sort by 'Name' and after running the program which will sort it by size I check the sort order in Windows Explorer again and it now says 'Size'?
I have a certain big folder structure that I want all of it and its subfolders sorted by size permanently. So I would like to run this program before viewing them and not have to individually manually re-sort them all first. Thanks!
The sort order belongs to the view, not folder. You can have two Windows Explorer windows open on the same folder, each has a different sort order.
To force a sort order when Windows Explorer navigates to a specific folder, first hook the DShellWindowsEvents::WindowRegistered event on the shellwindows object, then each time when the WindowRegistered event triggers, enumerate through the shell window list and compare with your existing enumeration to find the new windows explorer instance. Once you get hand on the new instance, hook up the DWebBrowserEvents2::DocumentComplete event for that instance to listen to its navigations.
When a navigation is complete, the DocumentComplete event will give you the target URL which you can use to detect if the target is inside your big folder structure. If so, query the IShellBrowser service from the windows explorer instance, then call QueryActiveShellView to get the shell view. Once you get the shell view, QI for IFolderView2 and then call SetSortColumns.
The Automate the Active Windows Explorer or Internet Explorer Window sample on codeproject has most of the code, except that it calls IShellView::SelectItem to simulate SHOpenFolderAndSelectItems at the end.
You can save Explorer sort settings by holding CTRL while clicking on that X on top right.

How do I handle the closing event of a windows explorer window using VB.NET

I'm working on an application where I have a list of hidden directories in a treeview. When the user double clicks on a folder in the directory structure, I open up that folder using the code:
Now, the the files within the folders are hidden as well so when it opens the folder, you cannot see the files (Provided view hidden files and folders is not selected.). What I want to do is:
1) when the folder in the tree view is double clicked, I will un hide the files, then open the folder using the process.start code so users will be able to see the files.
2)When the explorer window that opens up upon double clicking is closed, I want to hide the files again. This is where my query lies.
I figured I have the following options:
1) Handle the onClose event for this explorer window and add the code to hide the folders and files within this event.
2) Create a new form in my project an open the path in the process.start above, in this form. In other words, make my own windows explorer form so I can handle the onClose event of this form accordingly.
3) I know how to get the process ID for the explorer window when I start it using process.start. I could check when the process is killed, or exited and hide the folders then.
In a nutshell, I want users to double click the folder in the tree structure, open up that location in a windows explorer and browse it as they normally would browse any other folder on their computer, but I want to have the ability to specify what happens when that window is closed, i.e. hide the files again.
I would greatly appreciate any assistance on achieving my goal via any of the above mentioned methods or an alternative that you think would be better suited.
Thanks in advance.

Is it possible to hide a folder from a specific user? [closed]

I have a situation here.
I want to hide a folder from a specific user in Windows Seven.
This is not just a simple hide. I want to hide the folder from other 'Standard Users' (not administrator) logging into the system in such a way that they don't even know the existence of the folder.
I found that if a folder is hidden by administrator, then if the standard user enables 'Show hidden files and folders', the folder becomes visible. Well, they cannot access the contents due to permissions, that is fine.
But what I want is even if the standard user enables 'Show hidden files and folders' windows will not show the hidden folder to them. I want the folder to be seen by administrator only.
This does not necessarily mean that I have to 'hide' it.
I want to setup something which will allow only the administrator to know that the folder exists.
Is this at all possible?
If its possible please share the knowledge on how it is possible.
Thanks in advance.