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.htmScripting 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
- Open regedit, go to HKEY_CLASSES_ROOT, find the key ".htm"
- Expand the ".htm" key and find the key "OpenWithList"
- Create a new key under "OpenWithList" named after the editor you wish to add, in this example "vi.exe"
- Close things back to HKEY_CLASSES_ROOT and find the key "applications"
- Create a new subkey under "applications" with the same name from above. Ex "vi.exe"
- Create a new subkey under the key created in the last step called shell.
- Create a new subkey under shell called edit.
- Create a new subkey under edit called command.
- 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"
Changing the view for view source in Internet Explorer
- Open regedit, go to HKEY_LOCAL_MACHINE
- Expand the key "Software"
- Expand the key "Microsoft "
- Expand the key "Internet Explorer"
- Create key "View Source Editor" under "Internet Explorer"
- Create key "Editor Name" under "View Source Editor"
- Change the default value of key "Editor Name" to something named after the view you wish to use, in this example "vi.exe"
- Close things up and expand HKEY_CLASSES_ROOT
- Expand the key "applications"
- Create a new subkey under "applications" with the same name from above. Ex "vi.exe"
- Create a new subkey under the key created in the last step called shell.
- Create a new subkey under shell called open.
- Create a new subkey under edit called command.
- 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"
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
- Create a shortcut to "%systemdrive%\program files\internet explorer\iexplore.exe" -new about:blank and call it Admin Explorer.
- Right click on the new shortcut and chose properties
- On the Shortcut tab click the Advanced button
- Select the checkbox for "Run with different credentials"
- OK out of the dialog boxen
- When you run the shortcut, select "The following user:" and enter the credentials for the admin account.
- you can then on the address bar navigate to "Control Panel", "c:\", "My computer", etc.
This let's you have a cmd prompt with admin rights
- Create a shortcut to cmd and call it Admin Cmd.
- Right click on the new shortcut and chose properties
- On the Shortcut tab click the Advanced button
- Select the checkbox for "Run with different credentials"
- OK out of the dialog boxen
- When you run the shortcut, select "The following user:" and enter the credentials for the admin account.
- Right clicking on shortcuts gives an option called "Run As" from there you can choose what user to run the program as.
- From the command line that is a runas command used like this:
- runas /u:administrator cmd
- If you need admin locally and domain credentials remotely then try
- runas /u:administrator "runas /netonly /u:DOMAIN\account cmd
- If you need to open IE in another account, use runas with "iexplore -new"
- If you need to get at the control panels as admin, hold down SHIFT and right click to get a runas option. Note: Some things don't work correcting in this mode, I can't get folder options to realize that my admin account is admin, and some things require control panel classic view to have the shift right click work correctly.
- Another technique to get to the control panels as an admin is to use the IE as admin tip above and then browse to "Control Panels"
- A tip of last resort is to use the task manager to "End Process Tree" on explorer and then launch explorer from a runas cmd window.
Get IE to always show the status bar
Source: brettm in the ActiveNetwork Formus
- HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
- "Show_StatusBar"="yes"
- "Show_URLinStatusBar"="yes"
Copyright 2003 Ari Pernick
Theme Design by Bryan Bell