Home
b3ta
Wise Cat
Gallery
Software
Tutorials
Inkscape Pop-Art
Explorer Context Menu
RLM
Escher Toy
JSBombs
SingStar Database
Good Grammar
Navigo Review
Cabinet Calcs
Caveman Rock

Windows Explorer Context Menu Customisation

Yes, yes, yes. There's lots of information out there about how to add a context menu item for "Open with MyProg..." and "Send To > A Special Place". But it turns out that this is different.

In principal it should be the same. Pass the location you're at to the Remote Desktop application and Bob's your Uncle. In reality all the tutorials refer to using "%L", which is populated with the path to the selected file. Unfortunately, if the selected "file" is a computer in your network, %L gets set to null.

So, after much fruitless searching, I resorted to brute force; passing every variable I could think of to a script that echoed out their values.

It turns out that if your target object is a computer "%D" gets populated with its UNC name. So far so good.

Next hurdle is the fact that the remote desktop program doesn't handle UNC names so I needed to strip the leading backslashes off. Having spent far too much time on this already I went for the jugular and wrote a VBScript to do it.

Now all I have to do is get the command in the registry to call my script and pass the computer UNC name to it. Not the most elegant solution in the world but so what? It gets the job done.

Technical Bits

The registry entries. If you copy these lines and save them as a something.reg file then double clicking it will add the keys to your registry.

DISCLAIMER: IT'S NOT MY FAULT IF YOU FRITZ YOUR PC WHILE MONKEYING AROUND WITH THE REGISTRY. EVEN IF I GAVE YOU THE IDEA.

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\RemoteDesktop] @="Start Remote Desktop..." [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\RemoteDesktop\command] @="wscript.exe c:\\script\\remdesk.vbs %D"

The script itself. As you can see, in my case it is saved as C:\script\remdesk.vbs but you can call it whatever you like. Bear in mind that if you do rename it you'll have to change the command registry entry appropriately.

if (wscript.arguments.count = 0) then wscript.quit dim remhost remhost = wscript.arguments(0) if (left(remhost, 2) = "\\") then remhost = mid(remhost, 3) set wshell = WScript.CreateObject("WScript.Shell") wshell.run("mstsc.exe /v:" & remhost) end if

© 2008-2009 unstableOvine | Hosting by hostmonster.com - Unlimited Space, Traffic & Domains for $6.95/month