Just A Programmer We're just programmers

29Jun/100

Appcmd.exe and his amazing superfriends in %systemroot%system32inetsrv

Preface: Regardless of the size of your organization and segregation of job roles, every programmer must sometimes assume sys-admin related duties. Sometimes the programmer is also the sys-admin in a one man shop, and even in a large shop with many programmers and many system administrators, a programmer must develop the administrative procedures for the software he develops, and usually administers the working of his own box. Therefore, even though this is a programming blog, system administration tasks will be mentioned here.

Every once in a while I ask a question knowing I will be embarrassed to learn the answer. However, if google cannot lead me to the answer, there has to be someone exactly as stupid as me with he same problem. I write these words for thats persons enlightenment, and to allow everyone else to mock me.

So I was looking for methods for generating reports about IIS virtual hosts, when google pointed me to appcmd.exe. This is a swiss army knife executable for command line administration of several aspects of windows. Much of its IIS related functionality previously existed in vbsripts. The only problem was I could not find it. It was not available on my path and explorer search did not find it. I tried to find an appcmd feature or role to windows and did not find one. Finally, I violated the unwritten code of men and asked for directions. I opened a ticket with out co-location provider.

The response I got was short and professional. The executables full path is “c:windowssystem32inetsrvappcmd.exe”. I realized the following steps were necessary at this point:

  1. Add “c:windowssystem32inetsrv” to the system path.
  2. Write this article
  3. Figure out why my usage of explorer search did not turn up this executable.
  4. Write a follow-up article on how to modify ones path and other envirormental variables in Windows Server 2008.
  5. Write a followup article on how to search for files in explorer in Windows 2008

So stay tuned for more ar

21Jun/103

My new favorite tool, the Far File manager

Strange things excite me, things even other programmers would consider strange to be excited about. Every once in a while, something comes along that excites me in multiple ways. One of those things is the orthodox file manager, Far.

The far manager was developed by Eugene Roshal, who created WinRar. It was originally shareware, but has recently been made open source.

I’ve known about Far for a while. I first discovered it looking for a file manager that could handle a directory with thousands of files at a job where I was doing ETL operations. It was installed on my machine by a developer of ReSharper who was troubleshooting a very strange bug on my system remotely. Also I worked in a company where several Russian’s used it daily.

However, while I toyed with it several times, I never took the time to really get to know it until a few weeks ago. By really getting to know it I meant installing several plugins, and experiencing the “theres a plugin for that” joy several times over.

Overview

Far is a command line based file manager with two columns and a command prompt. The command prompt behaves similar to cmd.exe, but not exactly. For example, in a standard command prompt typing “cd e:foo” whike you are on the c: drive will change the current directory on the E: drive but you still have to type e: to get to that folder. In Far typing cd e:foo does both. One other difference, that bothered my unix sensibilities, is “cd ~” changes to the folder that far is installed to. In unix this changes to the users home directory so I was expecting similar behavior. There are probably many other useful command line enhancements that I’ve yet to discover yet as well.

Far Screenshot

Far File Manager

Installing Far and plugins.

Far is available on http://farmanager.com. There is a 1.7 and 2.0 version. The 2.0 version supports unicode asnd the 1.7 version us the legacy ascii version. You can get 64 bit binaries for both versions. You can install far via an MSI, or a 7-zip archive.

After you install Far, you will want to install several plugins. I will highlight my favorite ones here. ote that while binaries compiled against the far 1.7 SDK will work with Far 2.0, 32 bit plugins will not work with 64 bit far. For this reason you probably want to install the 32 bit version of Far, unless you are like me and like pain.

Except where mentioned, these plugins can either be found at the plugring site, or for 64 bit binaries, the evil programmers google code project. I will go through some of the plugins I like below.

7-Zip

As far as I know, there is no 64 bit version of this available yet. However, I probably just haven’t found it yet. If you install far without this plugin, you can browse the contents of most archives in Far. However, you will not be able to copy files out of them. I’ve yet to try getting the built-in archive support full working. However, with all the archives supported by 7-zip, I’m in no hurry to.

Event Viewer

This works like a text mode only version of eventvwr.exe. I’ve yet to find a truly compelling case to use it over the standar gui version. However, its nice to have an alternative tool for any job.

Service Manager

This is really convenient. It lists drivers and services temperately. It also allows you to edit things you can’t in the mmc snap-in, such as the path to the binary the service executes. Finally, it lets you create a new service. You rarely need to do this, but when you do its hard to find a good tool for the job.

User Manager

This one is really useful, especially on XP Home edition. Functionality is similar to the “Local Users and Groups” section of the Computer Management MMC snap-in on XP Pro. The thing I really love about it is you can set the “User must change password at next logon” flag on a user in XP Home Edition. I spent the good part of a train ride from Penn Station to Islip on Friday failing to achieve this in other ways. I’m not saying its the only way this task can be done. I’m just saying that this plugin will let me accomplish this task easily.

User Must Change Password At Next Logon

WinSCP

The arbitrariness of alphabetical order has put what is perhaps the most useful plugin last. There is a GUI scp/sftp client for windows called WinSCP. The author also made a Far plug-in based on the same code.

This plug-in, along with the 7-zip one, also take advantage of one of the most powerful intrinsic features of Far. With Far, you can copy any file from one panel to another, regardless of whether the panels contain a local folder, a unc path, the inside of an archive, or a sftp folder. Because of this, Far is a great tool for moving files to and from remote servers.

Conclusion

Far is a great file manager, and I will spend more time getting to know it. I think all programmers and sys-admins that work with Windows should get familiar with it as well.