Windows Workarounds


My desktop machines at work and home all run Windows, although most of my work takes place on remote unix servers. Below are a few workarounds that I have discovered that make my life easier.

Double-Clicking Files to Launch Emacs.

I have numerous Cygwin packages installed, including Gnu Emacs and an X-Windows server, but it was difficult to convince Windows that if I double-clicked a .tex file it should appear in a nice emacs window. Various attempts failed because either it would run emacs inside a DOS cmd window, or emacs was confused by Windows putting backslashes in the file's name, or it would create both the nice X-Windows version of Gnu Emacs and a blank cmd window. The following may not be the simplest method, but it does exactly what I want.

  1. Create a file runemacs.bat that invokes
    c:\cygwin\usr\X11R6\bin\run.exe /bin/sh /usr/local/bin/runemacs-helper %1
    (Using run.exe avoids creating a blank DOS window.)

  2. Create the file /usr/local/bin/runemacs-helper that contains the command
    /usr/bin/emacs "`cygpath -u \"$1\"`"
    
    This invokes emacs but first runs the cygpath program on the filename to translate it from the Windows convention to something that Gnu Emacs can understand. (The extra quotes help when paths have spaces, e.g., for files on the Desktop, which is below the "Documents and Settings" directory.)

  3. Tell Windows to use runemacs.bat to open all .tex files, via Open or Open With. Apparently one can use Tools/Folder Options/File Types in an Explorer window to change the icon for .tex files too, but I haven't done this yet.

Tunneling SAMBA over ssh.

From my office I can mounting my directories on various Unix or Macintosh machines as drives on my Windows box, but the department and/or campus firewall prevents me from doing the same at home. After some fiddling, I was able to remotely mount directories from two different machines simultaneously, using ssh tunneling via PuTTY's plink program and Microsoft's loopback (virtual) hardware device.

I'll put the details here when I get a chance.

Firefox vs. Logitech Keyboards

My Logitech wireless keyboard at work has all sorts of fancy extra buttons for running programs, launching browsers, etc. Occasionally I even remember that they're there. Unfortunately, now that I've switched to Firefox as my default browser, the iTouch software controlling the buttons can no longer launch web pages. Fortunately, as suggested here, one can change the button from "Web Site" to "Program", where the program being run is:

"C:\Program Files\Mozilla Firefox\firefox.exe" http://www.google.com/
or whatever web site is to be opened.

 

Last Modified June 5, 2005 by stone@cs.hmc.edu