Computer Hope

Microsoft => Microsoft Windows => Windows Vista and 7 => Topic started by: cincyshirm61 on September 17, 2013, 07:37:25 AM

Title: Add batch file to windows explorer toolbar
Post by: cincyshirm61 on September 17, 2013, 07:37:25 AM
Good morning!

I have a small batch file I call "Filenames" that I can drop into a windows folder, double click, and it will create a notepad file in the same directory with the pathnames of every ".pdf" file. The code for this is pasted below

Code: [Select]
@echo on

set pth = %~dp0

dir /s /b %pth%*.pdf >%pth%names.txt

end

Currently, I keep this file on my desktop and drag and drop it wherever I need it multiple times a day.

The other day I found a program called "CustomExplorerToolbar" that allows me to change the default buttons within the Windows 7 explorer toolbar (I wanted to remove "burn" and add "details pane, Paste, and Undo".  That got me thinking, it would be great if I could have a button called "Filenames" in that same toolbar, and whenever I click it, it would perform its function of whatever folder I am currently in, outputting the .txt file right there.  Can this be done?

Thanks in advance for the help!
Title: Re: Add batch file to windows explorer toolbar
Post by: DaveLembke on September 19, 2013, 03:05:06 PM
It can be done with C# programming and Visual Studio .Net Express edition, because one of the projects in the book was create your own browser and you can add features to your own custom browser, however I only worked through the lab project in the book and havent used it otherwise after, however I was working recently on a project in which C++ performs  batch like operations and I wanted to convert it from Console App to Windows App and C# looked to be easier to achieve this, so knowing that C# can process a batched instruction and also create a custom browser, if you get the book here to learn to make your own custom browser http://www.amazon.com/Microsoft-Visual-2008-Express-Edition/dp/B003D3OFLG (http://www.amazon.com/Microsoft-Visual-2008-Express-Edition/dp/B003D3OFLG) and research how to create a button to execute a batch instruction, it can be done.

While MSVS Express 2008 is slightly out of date it should still create programs that can be run on Windows 7 and 8. I was running Windows XP Pro when I was messing around with MSVS Express 2008, and am currently using 2010 with Windows 7. I would stick with 2008 if using this book though as for you will have to learn by example if new to C# programming and while 2010 will compile the program fine, you may find yourself lost between the book examples to features of this book intended for 2008 and running a different version. Personally I like C# a lot, however I mostly program in C++ and Perl for quick programs for personal use or quick fixes. C# is best for creating Windows applications for others to use and is a really good rapid development language.

More info here if you dont want to buy the book, however if new to C#, I would suggest this book. Its really good. I have the same books for C++ and Visual Basic. http://www.homeandlearn.co.uk/csharp/csharp_s9p6.html (http://www.homeandlearn.co.uk/csharp/csharp_s9p6.html)

And this link here shows creation of buttons to add to your custom browser in which one of them can perform what you want. http://www.homeandlearn.co.uk/csharp/csharp_s9p8.html (http://www.homeandlearn.co.uk/csharp/csharp_s9p8.html)
Title: Re: Add batch file to windows explorer toolbar
Post by: cincyshirm61 on September 20, 2013, 10:47:40 AM
Thanks for the suggestions!  I can see learning these languages being a great advantage with other tasks too.

In the meantime, does anyone else already know how to do this and want to help out?
Title: Re: Add batch file to windows explorer toolbar
Post by: cincyshirm61 on October 08, 2013, 12:01:20 PM
Bump. Anyone?
Title: Re: Add batch file to windows explorer toolbar
Post by: cincyshirm61 on December 04, 2013, 08:01:58 AM
Well, for anyone that cares I've found what I believe to be the next best thing to what I was originally looking for.  A program called FileMenu Tools, http://www.lopesoft.com/en/filemenutools .  This program lets you customize your right click menu, as well as add programs that run from any location you choose.  Very neat little explorer extension and does essentially what I was looking for.