Even this en route…Vinil Menon's blog

Experiences from the country of enlightenment…

Setting Notepad2 to run in unprivileged mode on Windows 7

Comments

Whenever I need to work on any computer for more than few minutes, I invariably download Notepad2 by Florian Balmer and follow a process adapted from Scott Hanselman’s post i.e.

  1. Extract the contents of the zip (viz. notepad2.exe and the config file) to system32 folder (so no messing around with PATH variables – too lazy to do that)
  2. Rt. Click on notepad2.exe and drag-drop within the same folder, which brings up the Context menu with the option to “Create a Shortcut here”. Select the option to create a new “Shortcut to notepad2.exe.lnk”
  3. Rename the shortcut to n.lnk

Now, whenever I need to run notepad, I just type “Windows-R, N, Enter”  and as Scott puts it, helps me “save at least a few hundred “otepad’s” a day.” I prefer this method over the other method that involves renaming notepad2.exe to n.exe

However, a couple of days back I noticed that Start->Running ‘n’ brought up a UAC prompt, and also prevented drag-drop into the resultant notepad2 window.

Guessing that Windows might have updated my UAC rules, it was time to check out what had changed.

Notepad2.exe’s property displayed that Privilege Level had been updated to require Administrator privileges.

Notepad2.exe Properties

A quick change later, I was back to saving a few ‘hundred otepad’s a day.

Written by vinilm

February 6th, 2010 at 9:00 pm

Posted in Tools

Tagged with , ,

Rover, Fetch!

Comments

I was busy with some code and was trying to concentrate when I heard a noise from my computer that sounded like someone or something was scratching. My first impulse was to kill all the browser windows thinking that it must be some amateur website that had some flash ad running. Yet, 2-3 minutes later, something scratched yet again. And, there was this distinct feeling that this sound was quite familiar (no pun intended!)

At this point, I killed everything except my explorer windows. And, yet I could hear the scratching sound. And, that’s when it clicked. Mr. Rover – the ever friendly search assistant had completed the “fetch” and was waiting for me to do something with him again!

How can you not like the dog! Seeing Mr. Rover again, I was reminded of an IronPython talk that Mahesh Prakriya (from the DLR team) had conducted at MS IDC. One of his demos used to show how easy it was to invoke Merlin and make Merlin do some wizardry using IronPython.

Interest piqued, moments later, I had the latest build of IronPython downloaded and was ready to make Rover appear. But now, Rover was nowhere to be found.

I asked Rover to show me his hiding place and it turns out that he’s hiding in “%WINDIR%\srchasst\chars\rover.acs.”

Copied this file over to %WINDIR%\msagent\chars and I fired up notepad2 and with the following few lines, got Mr. Rover up on the screen.

Note that you need to run  C:\>tlbimp c:\WINDOWS\msagent\agentsvr.exe from visual studio command prompt.

#rover.py
#from visual studio command prompt, run C:\>tlbimp c:\WINDOWS\msagent\agentsvr.exe
import sys
import clr
from System.Runtime.InteropServices import DispatchWrapper, UnknownWrapper
sys.path.append('C:\\')
clr.AddReference("AgentServerObjects.dll")
from AgentServerObjects import AgentServerClass
a = AgentServerClass()
#c = clr.Reference[int]()
reqId = clr.Reference[int]()
cId = clr.Reference[int]()
c = clr.StrongBox[object](DispatchWrapper(None))
a.Load("rover.acs",cId,reqId)
#copy rover.acs from c:\WINDOWS\srchasst\chars\rover.acs to C:\WINDOWS\msagent\chars
a.GetCharacter(cId.Value,c)
c.Value.WrappedObject.Show(0,reqId)
c.Value.WrappedObject.Think("I fetch, therefore I am!", reqid)
c.Value.WrappedObject.Hide(0,reqId)

 

Neat fun! It felt sad to read that Rover has not been invited to Windows 7.


Written by vinilm

September 28th, 2009 at 12:30 pm

Posted in Uncategorized

Tagged with , ,

Converting your Outlook Auto-complete email contacts into Address book contacts

Comments

I got an interesting query yesterday. How do I convert all the email addresses that Outlook caches into Contacts? A bit of probing revealed that Outlook stores the auto-complete cache distinct from the address book and doesn’t provide an easy way to browse the cache or to convert those entries into Contacts. The auto complete cache is stored in %APPDATA%\Microsoft\Outlook\Outlook.NK2 file.

To import the auto-complete entries into a Contacts folder in Outlook 2007:

  1. Run NK2View (download from http://bit.ly/nk2viewer)
  2. Select all the entries and Click on "Save Selected Items"
  3. In the dialog that pops up, select "Comma delimited text file" in the "Save as type" dropdown.
  4. Give a name and save the file. Also, it might be a good idea to run the command "File -> Backup Current NK2 File".
  5. Switch to Outlook and do a File->Import and Export.
  6. Select the following wizard steps:
    1. Import from another program or file
    2. Comma separated values (Windows)
    3. Provide the file name, and select appropriate duplicates Option
    4. Select the Outlook folder to import to.
    5. Select the map
      1. Select First entry on the list on the left i.e. "Name" and drop it onto "+ Name" on the right
      2. Scroll down in the Right Hand side list till "+ Email" is displayed
      3. Select second entry i.e. email address and drop it onto Email
  7. Press Finish and the import process should begin
  8. Verify that the contacts have been imported properly

 

Written by vinilm

September 2nd, 2009 at 12:15 am

Posted in Uncategorized

Tagged with

Get Adobe Flash playerPlugin by wpburn.com wordpress themes