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
Blog Traffic Exchange Similar Posts You May Like

  • Browser-Html5-Comparison-ChartHow Good Is Your Browser For HTML5? As the next major revision to HTML language is in progress - called HTML 5, leading browsers already started incorporating some of the features proposed in this standard. HTML5 provides array of tools to fulfill the needs of modern multimedia-rich web applications. With all the hype surrounding HTML5, no wonder......
  • dollars money purse walletHow To Drive Massive Traffic To Your Blog? Curious eh? Putting that term in Google gives you hundreds of blogs and articles suggesting different social media strategies, building great content, commenting on other blogger's post, social bookmarking, participating in forums, befriending fellow bloggers so on and so forth. No, I am not going to suggest any of that.......
  • blog traffic exchangeTen Steps To Become a Linux/Unix Geek Until recently, Linux/Unix was considered OS of the geeks. However, with GUI and more desktop Linux distributions, things have simplified on both Linux and Unix. Still you can geek out with Unix/Linux using its terminal. Just follow the steps below to master the terminal. 1. Never used Linux! Get Ubuntu......
  • 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......
  • 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......


Similar Websites You May Like

Leave a Comment

CommentLuv badge

Previous post:

Next post: