Google Ads

There’s no doubt about it, Microsoft Windows Media Center is a pretty fantastic product. There are competitors out there (Boxee, Front Row, and MythTV come to mind), but WMC is undeniably an amazing piece of software. It has continued to evolve and improve since Microsoft created its Media Center Edition of Windows XP, and now most home computers come with Media Center – it’s a standard component in Windows 7 Home Premium and Ultimate.

Combined with a good codec pack, Windows Media Center can handle pretty much anything you throw at it – I have no problems playing many different video formats, from the popular XviD and DivX to the slightly-less-common MKV format (which is frequently found as uncompressed 1080P video). However, as I started using WMC more and more with my little Acer L310 HTPC, I discovered I wanted a little more out of my MCE remote.

I’d had the good fortune to come across a used Microsoft MCE Remote v2, which undeniably offers the best support for MCE, seeing as it’s a Microsoft device made specifically for Microsoft hardware. Shortly after acquiring this remote and its accompanying USB receiver, I ended up getting a refurbished Logitech Harmony 550 universal remote for even more awesome control of my home theatre system.

I was disappointed to find out that the Harmony remote and its software can’t easily accept keyboard shortcuts (e.g. Ctrl+C) as remote commands. This makes sense, I suppose, since the remote uses standard IR commands for the many devices it supports. I was stuck with only the buttons that my MCE remote had, and I wanted more. There are handy keyboard shortcuts to access the media sections of WMC – pictures, videos, and music (the DVD menu button will take you to the movies section if a DVD isn’t currently playing). I wanted to program these shortcuts to the multi-function buttons around the LCD on my Harmony remote.

I first tried an older solution with an application called HIP, which theoretically could have let me reprogram the buttons on my MCE remote. Unfortunately, HIP relies on a modified driver for the USB IR receiver…which isn’t 64-bit compatible. I knew that Microsoft used to market an MCE keyboard that used IR, so if I could get my hands on one of those, I could teach my Harmony remote all the IR commands I was looking for. However, this particular keyboard is no longer sold, so I’d be stuck searching for one on eBay and elsewhere – not to mention that I really don’t need yet another keyboard floating around my apartment.

Finally, I happened upon a post on Logitech’s customer forums that mentioned the Microsoft MCE IR keyboard is in the Harmony software’s hardware database – you just have to know how to get to it! Instead of adding your HTPC as its own device, use the keyboard itself – it’s under Computer > Computer > Microsoft. Enter MCE Keyboard as the device, and presto! You have access to all 104 keys of a standard keyboard, plus some extra shortcut keys and MCE controls present on the original Microsoft hardware! With the Harmony software’s ability to enter key sequences in the “additional buttons” section, you can make your remote do anything you want – you can even further extend its ability with something like AutoHotKey, and assign a simple two-key shortcut to whatever scripting needs you might have.

With this discovery, I have exactly what I need to get the most out of my Harmony remote and my Windows Media Center experience. Keep in mind, however, that this solution will only work with Microsoft MCE-specific eHome IR receivers. Third-party MCE remotes use different receivers and IR commands; the keyboard’s IR codes will only work with an original Microsoft receiver.

My friend Danny is a systems administrator and all-around IT guy at a manufacturing company in Indianapolis. He recently came up with a pretty useful little script, and wanted me to pass it on to the world.

Recently I needed to find out which folders a certain person was able to access on our Windows network. Apparently, this was extremely easy in Novell. Since it isn’t 1995 anymore, I tried to find a way to do this on the Internet. I couldn’t, so I set about making my own.

Microsoft has a utility called xcacls.vbs (if you’re using Vista, you’ll have to make sure WMI is installed, and modify the script. If you can’t do that comfortably, you probably don’t want to be messing with the rest of this anyway). It will allow you to change and view ACL’s from a command line. Since I’m not that interested in modifying the ACL’s in a script, the usage is fairly simple “xcacls c:\windows” will result in a listing of who has entries in the ACL and what the entry is (n.b. you’ll also have to have the default script host be cscript. Wscript won’t work).

In order for this to be useful, we really need to be able to have it run automatically on several, if not all, folders on a computer. The first step would be to get a list of the folders we want to run this on. I chose to limit it to one folder and all its subfolders only (c:\ will do everything, while c:\windows will only do the folders in c:\windows. If you want to do c:\windows and c:\program files only, you’ll have to run it twice).

What I was looking for was basically a text file that just had all the folders. This command will create exactly that:

dir "c:\program files" /s /b /o:gn /a:d > c:\batch\xcacls\dirlist.txt

Now that we’ve got a list of all the folders we need to search, we need to actually loop through it.

For /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat administrator %%i

C:\batch\xcacls\aclSearch.bat is another batch file which takes two parameters (I’ll show you it in a minute). I call the other batch file so I don’t have to worry about how DOS handles variables (it doesn’t like to evaluate them during runtime, and will wait until the loop is done and use the final value for each iteration. It’s weird, I know).

A caveat about the for loop: when using for in an interactive CLI you use a single % sign in front of the i, when using it in a batch file, it’s a double %. Don’t ask me why.

aclSearch.bat contains the following

call c:\batch\xcacls\xcacls.vbs "%2" > c:\batch\xcacls\xcaclsResults.txt
 
find /i %1 c:\batch\xcacls\xcaclsResults.txt
 
if %errorlevel%==0 goto Found
 
goto End
 
:Found
 
echo %2 >>c:\batch\xcacls\%1results.txt
 
:End

This calls xcacls.vbs (from Microsoft) passing it the folder name. The quotes are there to handle filenames with spaces. It then sends the results into a temporary file called xcaclsResults.txt

Next we do a find using the search string (the first item passed – administrator in this example) on that file. If Find finds a match, the errorlevel is 0; if not, it is 1. If the errorlevel is 0, then the folder name is put into a results file named whatever the search string is, with results.txt appended (in this example it’d be administratorresults.txt).

So, how do you actually use all this? FindPermission.bat contains:

dir %1 /s /b /o:gn /a:d>"c:\batch\xcacls\dirlist.txt"
 
for /F "tokens=*" %%i in (dirlist.txt) do c:\batch\xcacls\aclSearch.bat %2 %%i

To search the c:\program files directory for anything the administrators group has access to you’d type:

Findpermission.bat "c:\program files" administrators

The results will be in the same folder you ran findpermissons from and be called administratorsResults.txt. To search the C drive for anything Danny Parrott has access to, you’d need:

Findpermission.bat c:\ "Danny Parrott"

The results from this one will be in Danny Parrottresults.txt.

This does require that Findpermission.bat, aclSearch.bat, and xcacls.vbs be either in the same folder, or in a folder that’s in the path variable. It will work for either users or groups. This process is also not instantaneous. The xcacl.vbs script can take upwards of half a second to run, so on larger systems, this is something you’d want to start and come back to later. On the plus side, though, it hardly uses any system resources while running (5MB RAM and 2-4% CPU time on a four-year-old server at work) so you can run it during the day.

My freshman year of college, I knew a kid with a Logitech MX700 cordless mouse. The first time I used it, I knew I had to have one. It was only a few months before I bought the Cordless Elite set, with the Elite keyboard and the MX700 mouse.

I have since discovered that this is the number one best mouse in existence. I’m not a gamer, so I don’t need high sensitivity and hair-trigger response. What I do need on a daily basis are the extra mappable keys that the MX700 (and its siblings) provide.

Logitech canned the MX700 several years ago in favor of the (in my opinion, at least) inferior MX1000. They still, however, produce a corded version – the MX518 gaming mouse. This is what I have in my office at work.

I typically map the second button below the scroll wheel to Ctrl+W, so that I can quickly close tabs and child windows in almost any application. There are, however, two applications I frequently use that do not follow the Ctrl+W convention – Outlook 2003 and SQL Server Management Studio. In Outlook, you need to use Esc to close child windows (messages, appointments, etc.). In SQL Studio, Ctrl+F4 is the only shortcut that will close open tabs in the interface.

Today, on a whim, I Googled to see if there was a way to map each of the mouse’s buttons differently for specific applications. Lo and behold, there is! It turns out that the SetPoint software required for Logitech’s newer mice uses XML for the configuration settings, so someone figured out how to enable lots of additional settings via the aptly-named uberOptions.

This application was ridiculously easy to install and use. I didn’t have to restart, or even manually shutdown SetPoint before installing. Once it was installed, I was able to quickly specify mapped keystrokes for Outlook and SQL Server, and was off and running. Changes take effect immediately – you don’t need to restart an application for its specific mappings to work.

If you have an older MX700-like mouse (the MX500, 700, 510, and 310), you can use an application called LogiGamer, although it looks to be a bit clunkier (and requires the .NET 1.1 framework; it’s old enough that it may not be compatible with newer .NET versions).

If you have a Logitech keyboard, uberOptions will allow you to customize all the keyboard’s extra keys on a per-application basis. I’m just glad that I can finally use the same shortcut button for the same purpose in all my applications!

At work, we use Microsoft SQL Server 2005. The client software requires Windows authentication to connect to a database. However, the credentials are pulled from your logged in Windows account. If you’re not on Purdue’s domain, you can’t connect. While putting my workstation on the domain wasn’t an issue, I prefer using my local user account on my laptop.

Vista supports fast user switching on a domain (XP does not, unfortunately), so I could switch between local and domain to use the SQL client, but running two profiles simultaneously is a bit of a resource hog.

Windows XP has a handy “Run As…” feature. If you right-click on an executable or shortcut, you can click “Run As…” and enter different credentials to load an application. This is especially handy if an admin needs to run something like the Management Console without logging out the user first.

Vista, for some inexplicable reason, has removed this feature. Fortunately, SysInternals came up with a handy little application that brings back the “Run As…” menu. It registers in Explorer’s context menu, and it can be used at the command line to load an application – which means you can create shortcuts specifically to run something as a different user.

It’s small, easy to install, and works great. You can get it here.

Every once in awhile, I like to peruse Sourceforge for new, interesting open-source applications. I was looking for a good screenshot application several months ago, when I was working on writing help documentation on a project at my job. I’ve since found out that the help documentation software, Adobe RoboHelp, includes a very nice screenshot manager called RoboScreenShot. This application, however, is not free, and I’m always interested in finding good open-source or freeware alternatives to commercial software. I have been in need of a small, open-source application that allows me to quickly take and save screenshots of applications, particularly since I’ve started writing these articles.

Enter Greenshot. This is a very small, quick application that allows you to take three different types of screenshots: your entire desktop, a selected window, or a selected region. Taking a cue from the application’s name, selections are highlighted with a translucent green region to show what you’re screenshot will contain. The application is small and fast, and allows you to either copy your screenshots to the clipboard for pasting into another program (for instance, PowerPoint or Word), or save it to your computer in JPEG, BMP, GIF, or PNG format. There are also limited annotation features, but I’ve found that this application is most useful when needing to send a picture of part of your screen to someone quickly and easily.

Read the rest of this entry »

Google Ads