Get selected items of folder with WinAPI

That’s a lot of hacking to do something that is explicitly supported by the various shell objects and interfaces. Granted the documentation doesn’t make it easily discoverable, but the functionality is there. Raymond Chen wrote a great article about using these interfaces. There doesn’t appear to be a way to get the “current” folder, though … Read more

How to programmatically restart windows explorer process

After parsing some of the earlier answers and doing a bit of research, I’ve created a little complete example in C#. This closes the explorer shell then waits for it to completely shut down and restarts it. Hope this helps, there’s a lot of interesting info in this thread. using System; using System.Collections.Generic; using System.Linq; … Read more

How to add a “open git-bash here…” context menu to the windows explorer?

Step 1. On your desktop right click “New”->”Text Document” with name OpenGitBash.reg Step 2. Right click the file and choose “Edit” Step 3. Copy-paste the code below, save and close the file Step 4. Execute the file by double clicking it Note: You need administrator permission to write to the registry. Windows Registry Editor Version … Read more

How can a batch file run a program and set the position and size of the window?

Here is an alternate way with nircmd util from http://www.nirsoft.net/utils/nircmd.html Examples: nircmd win move ititle “cmd.exe” 5 5 10 10 nircmd win setsize ititle “cmd.exe” 30 30 100 200 nircmd cmdwait 1000 win setsize ititle “cmd.exe” 30 30 1000 600 Here are the contents of SetEnv.cmd: Explorer /n,c:\develop\jboss-4.2.3.GA\server\default\deploy nircmd wait 1000 win setsize ititle “something” … Read more