Home » How-Tos » How To: Programmatically Open Folders

How To: Programmatically Open Folders

January 12, 2010

Recently as a part of support activity, I came across a unique task. This application had a windows service running on cluster of 8 different servers. To ensure that windows service is up and running, I had to check the timestamps of the log files this service was updating periodically. If timestamps on all the servers is within the reasonable limit, it meant that service is healthily running. Now the tiresome part of this task was to open shared folders located on eight different servers and checking the files. To add to my trouble, I also had to ensure that C&R (Crash & Recovery) servers are also in sync. So now I had 16 server shares to open and look for.

By nature, I am a lazy person and as you would have guessed, after doing the above exercise for about 10 days; my mind was trying to find a way to automate this task. Surely, I could have a written a small utility in .Net to check the files on these servers, but the efforts were not worth it. I wanted something quick and simple, something which can be achieved from command line. So I started looking for DOS commands which can do this, but I couldn’t find a command suitable for this. Google also didn’t help this time :( but while surfing, I came across an article describing EXPLORER.EXE process and I googled whether it supported command-line options and BINGO!

That was the solution for my task. Explorer.exe is windows process which is responsible for providing GUI for doing file and folder management activities through Windows Explorer. But the utility does provides certain command line parameters as well. You can see list of all command-line switches at Microsoft Support site. For my case, it was series of commands for each of the server as below, grouped together in a batch file:

Explorer \ProdServer1Logs
Explorer \ProdServer2Logs

Explorer \CnRServer1Logs
Explorer \CnRServer2Logs

Isn’t that nice and easy?

Note: I tested this on Windows XP and Windows 2003 server OS only. You may want to visit Microsoft Support site to know which options are supported for which Windows OS.

  • Share/Bookmark
Blog Traffic Exchange Similar Posts You May Like

  • blog traffic exchange5 Reasons To Say Goodbye To Internet Explorer Microsoft has long championed its own proprietary web browser, Internet Explorer. Internet Explorer 7.0 proves to be the current browser version promoted by the operating system behemoth. This comes installed on every computer that operates on the Windows Vista or Windows 7 operating systems. Although this Internet Explorer is the......
  • RSS ModelAll You Need To Know About RSS Yesterday I was chatting with one of my younger sisters and walking her through this blog. While going through the homepage, she noticed a link saying "Subscribe Posts". She was clueless about it. I, then, went ahead and explained to her all the nitty-gritty details of RSS - what are......
  • Ubiquity-Command-LineDo you know the Most Underrated Firefox Plug-in? Mozilla Firefox is a great browser and its greatness lies in its ability to extend – using plug-ins. Firefox has one of the richest collections of plug-ins – some terribly useful and mind-blowing plug-ins like Firebug while some not so good tweaky sort of plug-ins. But of all these, one......
  • Handyman-LogoHandyman - Chrome Extension of the Day Nothing is as valuable as Real Estate these days, so why should computers make an exception? I always try to find a way to maximize the screen space I get by closing unnecessary gadgets, tweaking windows, adjusting resolution, minimizing font size and so on. It irks me to scroll in......
  • Add New E-mail AccoutHow To: Setup Gmail Account in Microsoft Outlook Express in 10 Steps Have you ever wondered how great it would be to view your Gmails using your favorite email client? Are you bored of using Gmail’s web interface? Do you want to have the convenience of sending and receiving mails, searching and filtering mails, organizing mails, offline mail storage and all the......


Similar Websites You May Like

Leave a Comment

CommentLuv Enabled

Previous post:

Next post: