Creating a Start Menu Shortcut with Powershell and Python

[UPDATE 2008-05-13] Updated this post to use syntax Powershell 1.0 syntax instead of the original Monad syntax. A simple example that shows you how to create Start Menu shortcut. This example illustrates how to get the location of a windows “Special Folder” create and call methods on a COM object call methods on a .NET Framework…

1

Using Reflection in C# to print WMI object properties

Scenario You need to dump all the properties in a collection of WMI objects, but you don’t want to manually use WriteLine() for each property because it’s dull work. Here is a link to code sample you want to avoid is : http://www.microsoft.com/technet/scriptcenter/scripts/os/services/ossvvb08.mspx What you want A function that takes collection of WMI objects and…

0

Disable or Modify CAPS LOCK key

An annoying problem Do you accidentally hit CAPS LOCK all the time? Its placement on keyboards next to the ‘A’ key puts it in a heavy-traffic area.   Now solved http://johnhaller.com/jh/useful_stuff/disable_caps_lock/ Using the information at this site you can: disable the key entirely map it to another key (I prefer making it behave like the…

0

Extracting Files from a .MSI package

The Scenario One needs to retrieve a couple of files from a windows installer package (.MSI file). One could install the MSI and find the files in the *Program Files* folder but there are problesm: can take too long to perform the installation it’s desirable to avoid *polluting* the machine with unneeded software (files, registrykeys,…

0

UX: Being Good is better than being Consistent

The Inspiration This Dave Winer post on firefox ( http://www.scripting.com/2005/11/19.html#convincingFirefoxToSelectallOnClick ) reminded me to post my thoughts on UX consistency.   My Observation By default when we design a User Experience we default to being consistent with some standard (a convention or pattern of UI, a corporate guideline, a previous version, etc.). It’s a completely valid approach. I’ve seen…

0

Creating Strongly-Typed WMI Classes with Mgmtclassgen.exe

My recent work involved writing a C# to automating the installs of server products. A lot of the work involved using WMI. Generally, working with WMI in scripting languages like Perl, Python, or VBScript is easy but using it in C# can be difficult. WMI is very late-bound and that can be an unpleasant burden…

0

WinForms: Disabling the close button

What is desired You do not want the user to be able to click on the Close button (the little “x” in the upper right). Method #1: The ControlBox property The WinForm ControlBox property is a good place to start, but it shows or hides the entire control box. That means it either shows or…

0

My most important lesson about designing User Interfaces

Look at your screen right now. What do you see? If you design software you’ll see things like: taskbars or docks or apps or notifications. HWNDs and DeviceContexts. start menus, systray icons, docked windows   What our users see a piece of glass with glowing shapes on it.   My point We who work in designing…

0

Python Design Principles

[Update 2007-09-01] These are available here: http://www.python.org/dev/peps/pep-0020/ as a Python PEP.   19 principles behind Python from Tim Peters: http://www.python.org/dev/culture.html Of the 19, these 9 are my favorites: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. There should be…

0