We've moved!

TechKnack.blogspot.com has officially moved to TechKnack.net. You should be redirected in 3-5 seconds. Thank you.

October 10, 2007

Running .msc files with runas

Add this post to Del.icio.us. Del.icio.us (0 saved)

According to Google Analytics, I've gotten quite a few search hits regarding running .msc files (such as services.msc) under a Windows Limited User account using runas. I mentioned in a previous post that there was no way to do this without using a workaround. I'm sorry. I was wrong.

Apparently the mmc program accepts command line arguments. Typing "mmc services.msc" brings up...the services dialog! I tested it with a few other msc files in the C:\Windows\system32 folder; some of them work if you provide the name of the file only (such as services.msc), but all will work if you use the absolute path to the file (C:\windows\system32\services.msc).

And the best part...this method works with runas! Just be sure you put quotes around the mmc command:

runas /user:{admin} "mmc {path\to\msc_file}"

Enjoy!

October 9, 2007

Virtual Desktops - not just for *nix systems

Add this post to Del.icio.us. Del.icio.us (0 saved)

Wikipedia:
In addition to what is provided by the computer's physical hardware display, virtual desktops provide a "virtual" space, in which the user can place their applications' windows. Each virtual desktop occupies a defined portion of the screen arranged in a matrix or grid. Application windows and icons can be moved between desktops, increasing a user's ability to organize their windowed applications that are currently running by reducing clutter.
According to Wikipedia (the biggest source for popular knowledge), Virtual Desktops were first introduced in 1985 by the Amiga operating system. I've never heard of Amiga, but Linux systems have had "native support" for virtual desktops since the GNOME and KDE environments introduced the idea (date unknown). Boot up almost any Linux Live CD, and you are guaranteed at least two virtual desktops to play around with. Apple recently integrated virtual desktops as "Spaces" in Mac OS X Leopard. Complete with a shiny interface for switching back and forth between spaces. Windows...has yet to catch up. Per usual. On the bright side, however, there are many third-party programs that allow the Windows user to have VDs. Most of these programs are free, many are GPL, and all have at least one problem. You can try out the entire list from Wikipedia until you find one that works for you, but my preference is Compass. Compass is "dead" since 2001, as the author puts it, but its code is available under GPL. This is very fortunate, since I believe it could still use some work. But before I go on, here's the feature list from the webpage:
  • Themeing - 3 themes and a template included
  • Multi-desktop support - Not limited to 1 pager
  • Multi-quadrant support - Have as many virtual desktops as you want
  • Want your pager to be always on-top? on-bottom?
  • Move windows around using the pager window
  • Mark sticky windows
  • Hotkey support
Theming capabilities are always a plus (and the template is a PSD file, compatible with GIMP). I haven't tried the multi-desktop support, but it sounds like a nice feature for those with dual-monitor setups. As many desktops as I want? Nice. The always-on-top-or-bottom feature is nice, but this can cause problems. Move windows from desktop to desktop using the interface - very useful. Sticky windows; good for keeping WinAMP, various Yahoo! widgets, and RKLauncher on every desktop. Hotkey support; what keys do you switch with? Ctrl+Alt+Arrow? Win+Arrow? F? Spacebar? While the app still works under Windows XP (dunno about Vista), it is lacking in a few features that would make it near-perfect:
  • Autohide: the always-on-top feature is nice, but without an autohide feature, it tends to get in the way at times.
  • Any-desktop window moving: you can only move windows from the current desktop to another desktop; inactive desktops are automatically switched to when you click, there is no way to drag windows amongst inactive desktops.
  • It touched my registry! While I don't mind a program storing settings in my registry if I've installed it, an app like this should be getting its settings from a file (which would also make it perfect as a portable app!). If you want more than the default of two virtual desktops, you have to merge a reg file.
In spite of these shortfalls, Compass is probably the best Windows VD manager I've come across. No fancy 3D cube effects, but it works. Better yet, my feature requests shouldn't be too hard to add, given that "the code is straightforward C and Win32". This'll probably be a good summer break project for me ;) So, do you use a VDM under Windows? If so, which one? And what do you want in a VDM that isn't offered by Compass? Leave a comment!