Ari's WinXp Tips, Notes and Annoyances

Associate file types on the command line
Command Line Reference
Scripting Windows/MSN Messenger
Changing the html editor and view source viewer in Internet Explorer
Tips for daily usage as a nonadmin
Get IE to always show the status bar

Associate file types on the command line

Source: Ftype reference in the Command-line reference

To associate a type and assigned it a launch command:
ASSOC .pl=PerlScript FTYPE PerlScript=perl.exe %1 %*
now you can invoke like this:
script.pl 1 2 3
To eliminate the need to type the extensions, type:
set PATHEXT=.pl;%PATHEXT%
To invoke the Perl script, type:
script 1 2 3


Command Line Reference

Source: Bob cerelli's Windows Xp Tips

hh.exe ms-its:C:\WINDOWS\Help\ntcmds.chm::/ntcmds.htm


Scripting Windows/MSN Messenger

MSDN has published some of the Messenger API (note that Messenger.Messenger is really Messenger.UIAutomation). Here is an example script that lets you start a voice conversation from the command line:

' verify the command lines options
Set objArgs = WScript.Arguments
If (objArgs.Count < 1) then wscript.echo "Usage: " & Wscript.scriptname & " " wscript.quit 1
end if

on error resume next

' Get the messenger object set
msim = CreateObject("Messenger.UIAutomation")
if err.number <> 0 then wscript.echo "Can't find messenger object" Wscript.quit 2
end if

set contact = msim.GetContact(objargs(0), msim.MyServiceId)
if (err.Number <> 0) then wscript.echo "Unable to find contact (" & objargs(0) & ")" wscript.quit 3
end if

msim.StartVoice contact


Changing the html editor and view source viewer in Internet Explorer

Adding an editor to the html editor list in Internet Explorer

  1. Open regedit, go to HKEY_CLASSES_ROOT, find the key ".htm"
  2. Expand the ".htm" key and find the key "OpenWithList"
  3. Create a new key under "OpenWithList" named after the editor you wish to add, in this example "vi.exe"
  4. Close things back to HKEY_CLASSES_ROOT and find the key "applications"
  5. Create a new subkey under "applications" with the same name from above. Ex "vi.exe"
  6. Create a new subkey under the key created in the last step called shell.
  7. Create a new subkey under shell called edit.
  8. Create a new subkey under edit called command.
  9. Change the default value under the key command to the full path to your editor in quotes plus "%1" (with the quotes) Ex: "c:\vi\vi.exe" "%1"
This is doing two things. Steps 1-3 tell IE to try to use an editor with the name specified. Steps 4-9 tell the shell how to use the edit verb on that application name. The quotes are important. The quotes around the full path the executable keeps the program in one group, and the quotes around the %1 makes it such that the whole file name is accepted even when it has a space in the path (which it almost always does).

Changing the view for view source in Internet Explorer

  1. Open regedit, go to HKEY_LOCAL_MACHINE
  2. Expand the key "Software"
  3. Expand the key "Microsoft "
  4. Expand the key "Internet Explorer"
  5. Create key "View Source Editor" under "Internet Explorer"
  6. Create key "Editor Name" under "View Source Editor"
  7. Change the default value of key "Editor Name" to something named after the view you wish to use, in this example "vi.exe"
  8. Close things up and expand HKEY_CLASSES_ROOT
  9. Expand the key "applications"
  10. Create a new subkey under "applications" with the same name from above. Ex "vi.exe"
  11. Create a new subkey under the key created in the last step called shell.
  12. Create a new subkey under shell called open.
  13. Create a new subkey under edit called command.
  14. Change the default value under the key command to the full path to your editor in quotes plus "%1" (with the quotes) Ex: "c:\vi\vi.exe" "%1"
This is simular to the other hint, except you register in a different place, and this command uses the verb "open" instead if "edit"


Tips for daily usage as a nonadmin

One of the saddest things about Windows XP is that by default users are still running as administrators on thier boxen on a daily basis. It makes life easier in terms of application compatability and installing software, but it constantly leaves the machine at risk of unrepairable damage form the next virus or trojan. If you are running home edition or professional not joined to a domain, the simplest method is to just create a nonadmin account and use fast user switching to an admin account when you need to. For the rest of us here are a few tips to help:

Please note that when you use any of the tricks below you are increasing your risk for the life of the session with admin rights. This is because the admin rights process are created in the same windows session, which means that they are not partitioned from the non-admin session. The risk is not as bad as just running all the time as administrator, but it's not perfect either.

Admin explorer
This let's you have a explorer or internet explorer with admin privlidges

Admin Cmd
This let's you have a cmd prompt with admin rights Other Stuff

Get IE to always show the status bar

Source: brettm in the ActiveNetwork Formus