Even this en route…Vinil Menon's blog

Archive for the ‘Windows’ tag

Setting Notepad2 to run in unprivileged mode on Windows 7

leave a comment

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!

leave a comment

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 , ,

Sound Recorder

leave a comment

 

I get the laptop upgraded to 4GB and I assumed all my out of memory errors can be now stuff of the Dead Sea Scrolls.

I fire up an instance of sndrec32 and record 5 seconds of voice when I am greeted with this!

Out Of Memory Exception on a 4 GB system

Not enough memory available to complete this operation!

And, I have about 2 GB available as per task manager ;)

So, a basic search later, it is confirmed that I need to reduce my system RAM if I need to use Sound Recorder! Choices, choices!

Written by vinilm

November 14th, 2008 at 12:24 am

Posted in Uncategorized

Tagged with ,