Skip navigation.

Hacking around

To make life easier

Hello World without hello world

,

So a little programming task for all of you who like to solve problems. Write a program that prints out "hello world" (without quotes) without using "h", "e", "l", "o", "w", "r" or "d" in the code at all, not in strings nor in variable, function or command names or any reserved words. Let's see how many different solutions in different programming languages we can get.

Post your solutions in comments and make sure to also mention which programming language it is written in.

Regshx - Registry editing shell tool

, ,

So this is my first post on My Opera blog. My main blog is hosted at Xfire: http://blog.xfire.com/godjonez/ and I also post on the official Xfire blog "The Blog": http://blog.xfire.com/theblog/

I decided to use My Opera blog system to post about some of my other projects. I shall start with a little utility I wrote in C. As always I did the tool for my own personal need, but since other people might find it useful, why not sharing?

The tools is named very confusely Registry editing shell tool, because what it does is editing Windows registry by the commands you give to it in command line. The shortened name is regshx, a bit derived from netshx tool :wink:


The features of this tool shortly...
Features that target a single, specific item at a time:
  • mkkey - Create registry keys
  • rmkey - Delete registry keys
  • set - Create/set string values (REG_SZ)
  • sete - Create/set string values (REG_EXPAND_SZ)
  • get - Get values (REG_SZ, REG_DWORD, REG_BINARY)
  • getbatch - Get values expanding % to %% to conserve environment variable references in batch files
  • rm - Remove values


Features that crawl through the registry and apply the command to all matches:
  • find - Find keys, values and/or data by partial case-insensitive matches (all other functions here use this one behind the scenes)
  • del - Delete keys, values and/or data by matches
  • delc - Delete containing keys of matches
  • replace - Replace text in keys, values and/or data
  • replaces - Replace text in keys, values and/or data if the text matches exactly (no partial matches), still case-insensitive
  • replaced - Replace text completely even if partial match
  • rbak - Copy data from one value to another inside a key


The syntax of the program is:

regshx [/v] [-kvd] command "specifier" ["new value"] [ROOT] [start key]

Bold text means text to be written as-is, italic text means it is a symbolic argument and must be replaced with actual text. Parameters inside square brackets are optional or not always applicable.

The /v parameter turns on Verbose mode that will output stuff to stdout. Usually the output consists of the affected keys/values. When Verbose mode is not used, successful commands normally do not give any output (useful for batch scripts). On interactive mode I recommend using Verbose mode.

The -kvd parameter is used for the second list of commands. You can specify any or all of the letters in any order to specify which elements match to the search criteria:
  • k - match key names
  • v - match value names
  • d - match value data

If this parameter (must start with the hyphen/minus sign) is not supplied, the program defaults to matching to all content, equal to using -kvd.

The command parameter specifies what the program is to do. The different commands are described above in the two lists. Starting regshx with no or invalid parameters will display a short help with all the command names and their descriptions.

The specifier is required parameter and is the main target for the command. For example for mkkey command this specifies the key name to be created. For find and other multi-target commands this is the text to be searched for.

The new value parameter is only used by some commands: set, replace, replaces, replaced and rbak. With those commands you must include this parameter. With all other commands you must not include this parameter.

The ROOT parameter specifies which hive to handle. Valid values are the names HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE and HKEY_USERS. Abbreviated names can also be used: HKCR, HKCU, HKLM, HKU. If this parameter is missing, then the program will use HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER (for single-target commands) or HKEY_USERS (for multi-target commands). Note that this parameter is case-sensitive. If the value does not match any of the strings mentioned above, then it is not considered to be a value for this parameter.

The start key parameter specifies the path in which the operation starts, inside the chosen hive. The actions never affect parent keys of this parameter (with the delc command being an exception, in case the base key itself matches).


Some example usages:
:Create .avi file association to mplayer.exe
regshx /V mkkey .avi HKCR
regshx /V set "" "VideoFile" HKCR .avi
regshx /V mkkey VideoFile\shell\command\open HKCR
regshx /V set "" "mplayer.exe %1" HKCR VideoFile\shell\command\open

:display all keys in HKEY_LOCAL_MACHINE\SOFTWARE containing Opera in them
regshx -k find opera HKLM software

:restore old file associations that were changed by ShowTime install
regshx /V rbak ShowTime.bak "" HKCR



There may be bugs with the program, I haven't been able to test every possible case, of course. Please leave a message in comments if you like/dislike the program and if you find something wrong with it.

And then the mandatory warning:

THIS IS A DANGEROUS TOOL! YOU CAN MESS UP YOUR WINDOWS REGISTRY VERY EASILY WITH IT, USE WITH CARE!

That said, I won't take any warranty of you using the program. It is provided "as is" and all that other mumbo jumbo. Know the risks.

Now if you really want to try it out (if you are a power user of Windows, you know you want to), here it is:
regshx.exe (source code: regshx.c)