For several projects I work on, I need to load Visual Studio (2022 Enterprise edition) in “admin” mode.
That’s easy enough to do, but I always have to click through the UAC prompts, which is tiresome.
Turns out there’s a (relatively) easy way around this.
I stumbled across this article by Lowell Heddings on how to “Create Administrator Mode Shortcuts without UAC prompts” accidentally which clued me in that this was even possible. I highly recommend checking it out.
I’ve embellished the technique slightly because I found that VS would end up coming up behind all the other open windows, which is even worse than the UAC prompts.
I’ll summarize the process below:
Use Task Scheduler to create a new task
Give the task a short name (I called mine “Visual Studio 2022”, set it to Run only when user is logged in
Use YOUR user
Check Run With Highest Privileges
Configure for Win 10/11 whatever works for you
On the Actions tab
Create new Start a program action
Specify full path name to devenv (Visual Studio), no args; “C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe”
Set this action to “nircmd win focus process devenv.exe”
On the Settings tab, make sure that the combobox near the bottom says “Run a new Instance in parallel” and not “Do not start a new instance”. That way, you can still launch multiple instances of Visual Studio if you need to.
Save the Scheduled Task
Create a new shortcut on the desktop
For the shortcut path use “C:\Windows\System32\schtasks.exe /run /tn “{your task name from step 2 above}”
And that’s it.
If everything’s kosher, dblclicking on that shortcut will launch VS in Admin mode, in the foreground, with no UAC prompting.
I was contemplating having to pave a machine recently, and it occurred to me that it might be a good time to take stock of the “asphalt”, so to speak.
In other words, what are those apps and configurations that get laid down first? Those that I use everyday. That it’d be seriously difficult to do without, even from day one?
I’ve followed Scott Hanselman’s List of Tools for years. It’s a great list, and a fantastic place to get ideas for things that might dovetail into your personal workflow, so if you haven’t already checked it out, I heartily recommend it.
But it’s huge! I mean, really big. It’s a great reference, but I can’t imagine anyone using near that much on a daily basis.
So, what’s my asphalt then? Lets get right to it!
File manager – DirOpus. If you deal with files all day long, DirOpus is the first thing you should consider laying down. Fast and infinitely customizable, but it still feels like a Windows File Explorer.
Font – Hackd. My own version of LigaHack, which is itself a ligaturized version of Hack.
Editor – Visual Studio Code. I’ve used tons of different editors over the years, so VSCode is just the latest. It’s fast, flexible, extensible and customizable.
Password – Keepass. Hands down. After seeing news stories of all the commercial “credential managers” out there, I’m convinced high value targets like that are the last place you want to put your keys. Just make sure you back up.
Launcher – Flowlauncher. PowerToys Run is right up there, but FlowLauncher is xcopy installable, and super easy to write extensions for, as well as having just about any extension you’d ever want already available.
Backup – SyncBackPro + BackBlaze. Both are very reasonably priced. BackBlaze for offsite backup. SyncBack for synchronizing laptops, desktops, phones, etc.
Compare – Araxis Merge. I’m doing file or folder compares virtually every hour. I’ve tried others, both free and commercial but Araxis just feels the smoothest, and most polished. It’s not cheap, but I think it’s worth it.
Clipboard –ClipCache. Ok. There’s loads of free clipboard managers out there, and not just a few paid ones. But ClipCache does it all, it’s not very $$, and it just works.
Terminal – Windows Terminal + Cmder. I’ve never been able to get on the Powershell wagon, so there’s that. But Cmdr in Windows Terminal, with PowerLine glyphs and quake mode is awesome.
Macros – AutoHotKey. I’ve got my own set of favorite hotkeys that I’ll be writing about soon.
Search – FileLocator Pro. Absolutely worth the (small amount of) money, esp with the new Index functions.
Screenshots – ShareX. Free and fantastic for screenshots, recordings and annotating.
And just to be straight. All of the links above are direct links to the apps I mention. I’m not an “affiliate”. I don’t get any money for “clicks” to these links. I have no relationship to any of these companies except as a customer.
So that’s it. These apps (and font ) are running virtually 24/7 on my machines.
Download my custom Hackd font here. Unzip, and install the two TTF files. That’s it.
On Programming Fonts
I’ve long been a fan of dedicated, monospaced programming fonts. I’ve even got a page here dedicated to a breakdown of most of the fonts I’ve had the opportunity to work with and review over the years.
I’ve used a number of these for a good period of time, including Consolas, Cascadia Code, and FiraCode among others.
But, for some time now, Hack has been my goto choice. It’s clear, simple, with good spacing, and excellent readability.
Alas…
As usual, though, there’s a few things that have always not sat well with me.
First, Hack has a peculiar dotted zero.
That’s just always seemed off to me.
Plus, it’s percent sign just didn’t jive with the rest of the font.
And then there’s ligatures.
The Ligatures
If you aren’t familiar with ligatures, they’re basically substitutions of a single, conhesive glyph for 2 or more glyphs places next to each other.
For instance, a ligature for “greater or equal”, “>=” might look like this:
It’s important to note however, that ligatures are just a rendering nicety. They don’t actually change the characters you type at all. So, although it might look like one character on screen, your file’s content will still be “>=” just like it always has been.
I realize that there’s a lot of gnashing of teeth online about whether ligatures are worth it or not. In the end, I think it’s completely a matter of preference, and I happen to find them quite nice to look at and helpful during my day to day coding.
And Hack doesn’t have ligatures
When Monospaced isn’t Monospaced
Virtually all dedicated programming fonts are monospaced; every glyph has the same width. But, while a font might say that it’s monospaced, and might have all the right metadata to indicate that it’s monospaced, it turns out that all that doesn’t necessarily mean that it is monospaced.
In fact, there are some apps out there that detect a monospaced font not via metadata, but rather via a Windows call that actually tests if all the glyphs are the same width.
I happen to use a couple of those apps and, as it happens, Hack doesn’t pass that test, so it’s not listed as a choice for font in those apps. And that has been a (rather admittedly trivial) thorn in my side for some time now.
Introducing Hackd
So without further ado, I’d like to present my own take on a programming font; Hackd!
Hackd is based on Hack v3.003, used for most base symbols and upper/lowercase latin glyphs.
I then merged in glyphs from FiraCode v6.002 for all ligatures and pretty much all other characters.
Further, I pulled the % glyph from Firacode and tweaked it slightly to look more “Hack”ish.
And finally, I merged in the Powerline glyphs from “Hack Regular Nerd Font Complete Windows Compatible” from the NerdFonts collection.
NOTE: I left out virtually all of the excess glyphs from NerdFonts, including company logos, weather symbols, etc. I just don’t see much utility in having them in the font, unless, maybe, there might be some use for them in some kind of command line terminal customization? I did include the PowerLine symbols for that reason.
Would love to hear any comments on that…
How I Did It
I used FontForge for all manipulations.
I started with FiraCode-Regular and FiraCode-Bold.
Replaced all the glyphs from ! through ascii 255 with the Hack glyphs.
Then pulled all the powerline glyphs from the Hack NerdFont ttf file.
Replaced the % sign using the FiraCode version, then tweaked it by scaling it and repositioning it slightly to look better.
Tweaked all glyph widths to be the same. This automatically causes FontForge to generate a proper “monospaced” font that truly is considered monospaced. Originally, Hack had several glyphs that had a 0 advance, which caused the font to not be considered monospace, even though it really should be.
Updated various metadata in fonts to reflect the history, source, new name and version number.
Repeated all this for both the Regular and Bold versions of the font.
What About Italics?
Once that was done and the new fonts installed, the regular, italics, bold and bold italics alternatives were all available, so I did not create the BoldItalic, Italic, BoldOblique or RegularOblique alternatives as they didn’t seem necessary.
Disclaimer
I’m no fontographer, and I definitely couldn’t have done this without the fantastic work done by the Hack and FiraCode authors, much less the author of FontForge, so my hat’s off to all of them!
Font choice is a highly personal thing, and this work reflects my own personal preferences and taste. My main reason for documenting this is to show that there are tools available that make this kind of customization completely possible, if not easy.
This site’s been chugging along for years now. I’ve been super happy with my hosting company, NameCheap, and everything has just worked.
Until, of course, it didn’t.
I used to use Microsoft’s LiveWriter way back when, but then, they quit updating it and it quit connecting to my blog so… I just used the WordPress editor and continued on.
I finally had minute to take a look and realized that I hadn’t updated WordPress is quite some time.
So, back up the site, then update… oops, no, I’m using an ancient version of PHP.
So, update PHP to 8.1
Update WP to 6.1
Bam!
Critical error loading WordPress
Oh Joy
So I start all the typical stuff. I’m no WordPress expert, by any stretch.
Update all the plugins.
Nope
Disable all the plugins.
Nope
Clear caches. Reset Themes.
Nope, and Nope.
This might turn into a long night.
So I punt.
The guys (and gals) in NameCheap support have pulled me out of a wringer before, so I figured I might give em a shout. The worst they could do is tell me “that’s your programming problem”.
Joy
So I search the Knowledge Base right quick, come up empty, and finally decide to file a support ticket.
Within an hour, I get a message back that they’d had a look at my WordPress log and the issue appeared to be with my theme at line x.
No freakin’ way!
Open the theme INDEX.PHP up and, sure enough, turns out the old WordPress was more forgiving with PHP files that used <? … ?> instead of the newer style <?PHP … ?>
Literally 2 lines of code changed and presto. Entire site back and running!
And not only that, the latest OpenLiveWriter (the open sourced version of my old friend), recognized it and loaded up perfectly. I’m even writing up this entry using it!
I do a lot from the command line, so starting VSCode to quickly edit a file I’m looking at can be a big help.
VSCode isn’t automatically added to the path, so it won’t normally be available. Besides, if you’re using the Insiders build, the exe name will be Code – Insiders.exe, which is, um, unwieldy, to the say the least.
I know there are other solutions out that that might make more sense depending on your situation, for me, setting up a simple BAT file to start the editor made the most sense.
I already have a folder full of utilities and BAT files that I always add to my path anyway. Plus, I like having a bit of flexibility that wrapping VSCode in a BAT file gives me.
Anyway, here’s what I’ve ended up with.
ECHO off
REM Starts VSCODE and returns immediately to the console where it was started from
REM Running it a second time just opens the new file in a new tab in the existing VSCode window
start /MIN /B "" "C:\Users\darin\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9 >nul
Using this, I don’t get “leftover” phantom command line windows, I don’t get random debug logging in the terminal window I started it from, and it all “just works”.
Of course, you’ll have to adjust the path if your name’s not “darin” 🙂 , if you’ve installed VSCode in a non-standard place or if you’re using the normal, not Insiders, version.
I’ve been using a triple monitor setup with all three running at high DPI (4k) resolution for some time now, and I love it. I use 200% scaling, so text is reasonably sized, but at 4k resolution, it’s so much clearer and easier on the eyes.
For the most parts, apps “just work” at that scalemode. But every once in a while, I’ll run into one that doesn’t.
Notice how the toolbar icons are tiny! The app’s excellent and I use it all the time, but the developer, while still supporting it, isn’t all that responsive towards updates, unfortunately.
But, it turns out there are things to try that might just resolve these sorts of issues without resorting to code updates by the developers.
Find the EXE file for the app in question. In this case, it’s Clipc.exe.
Right click and choose Properties, then Compatibility:
Now click Change high DPI settings.
You may have to experiment with the settings here. In the case of ClipCache, I set the Program DPI to checked.
Then checked Override high DPI scaling behavior.
And finally, selected System (Enhanced).
I suspect other apps may require slightly different options.
I’ve been doing a lot of reflecting lately on how my typical workday progresses and one of my primary realizations is that I spend a lot of time switching between applications.
There’s all the typical development applications, Visual Studio, VSCode, Command line, GIT, Insomnia, Web browsers, file search, clipboard stuff, etc. There’s usually an instance or two of these running, and I often find myself ALT-TABing between them.
Then there’s various utilities that I use regularly but not necessarily constantly: putty, SSH, Fusion, Dbgview, etc. Find it, Open it, Use it, Close it, repeat.
And finally there’s all the other apps that hang out in the periphery: Word, Excel, Outlook, Zoom, Remote Desktop, VMs and so on.
Now, I’ve pinned a few of those to the taskbar, so they’re just a mouse click away. However, there’s only so much space down there. Sure, I could stack some in a folder, which would present as a menu, but then often used items would inevitably end up hidden behind one or more layers of menus.
Of course, there’s the Start menu. But after awhile, that becomes large enough to prevent any kind of speedy access. And then there’s the Start Panel, but again, it can begin to get unwieldy fairly quickly for me.
Plus, when customizing the Start menu, etc, there’s the issue of synchronizing changes between machines. Google Drive helps, but not really for the Start Menu or TaskBar.
As I hinted at above, part of my realization was that there’s three levels of application usage for me.
Utility Belt Apps
These are apps that I almost always have running. I need to switch between them quickly and seamlessly. Adam Savage, of Mythbusters and Tested fame, even has a term for it, which I completely forget and can’t seem to locate right now. Irony?
In any case, the idea is that you shouldn’t have to move any tool to get to any other tool. And I can’t think of a better way to describe Toolbelt level applications.
And for that kind of accessibility, you’re really talking about one thing; hotkeys.
Windows does have the ability to assign hotkeys to shortcuts, icons, etc. but the selection is pretty limited, and when you regularly work with applications like VSCode or Visual Studio, most of the typical hotkeys are already in use by those apps.
Further, if I have two or more instances of any particular Toolbelt app open, I need to quickly switch between those instances, not go Alt-Tabbing through every opened desktop window.
Toolbox Apps
These are those apps I use often but that don’t really deserve being added to my Path. For these, finding them is usually the most time-consuming part. They aren’t constantly in use, but none-the-less, I’d like them to be ready at hand. For instance, when you need to hunt down a library binding issue with a .Net application, I’m gonna reach for FusLogVw, but that app isn’t normally on the path, or easily locatable.
Junk Drawer Apps
Everything else, which I’m perfectly comfortable leaving in the Start Menu where they’re installed and digging them on when I need them. They’re not used enough to justify going on the Toolbelt or in the ToolBox.
How you break things down? Have I missed anything?
I’ll be posting more as I start to solve this problem.
I’ve seen a few articles here and there about Capslock, but now I’d like to throw my own spin on the topic.
Capslock is probably the most useless key on modern keyboards. It’s an antiquated holdover from the days when typing was actually a quite physical activity.
But now, about the only time Capslock gets hit is by accident. It’s BAD FORM TO SHOUT THESE DAYS, after all.
So… what can we do about that?
Ctrl, Alt, Shift Oh My!
If you’re anything like me, you spend your days in a host of applications, all of which have various functions assigned to just about every conceivable combination of hotkey. There’s all the standards: Ctrl-V, Ctrl-C, Ctrl-X. There’s the Ctrl-Shift variants and the Ctrl-Alt variants. Then there’s the less common Alt-Shift variants.
And then there’s those sadistic Ctrl-Alt-Shift hotkeys that exist just to make sure if you didn’t already have carpal tunnel, you will soon enough.
But what if you could use that CapsLock key as another modifier key; a Ctrl2 if you will?
Suddenly, you have a whole smorgasbord of easy to type hotkeys available. Not to mention Shift-Ctrl2 and Alt-Ctrl2 options as well.
And sure, Ctrl2-Shift-Alt, Ctrl-Ctrl2, and, well you get the picture.
Macro Apps
Sure there are macro applications and hotkey applications out there. Plus, your favorite applications may already have customizable hotkeys built in.
But, they likely only support some combination of Ctrl, Shift and Alt for hotkeys, which doesn’t much help with repurposing that CapsLock key.
Remapping
The first step toward solving this problem is changing the CapsLock key to something , almost anything, else.
It turns out, that’s far easier than you might think. On Windows, you can actually remap virtually any key to any other key with nothing more than a registry entry and a reboot.
“Ugh!” you say. “Editing the registry!”. I get it.
It’s a tiny little app that takes the guesswork and tedium out of editing the registry for this purpose.
Here’s the entry I used. This will make the CapsLock key act like an F19 key (yes, there’s actually far more function keys than just the F1-10, but most keyboards don’t have them).
Why F19? Meh. Seemed like a far enough out-of-the-way F key to not likely get mixed up with any application’s intentional use of a function key. Plus, it works easily with the technique I’ll go into below. But choose whatever you like. There’s F1-24, plus quite a few Unknown key codes as well that would probably work too.
Click the Write to Registry button and close, then reboot. And done.
When your PC comes back up, give it a try, press Capslock.
Nothing. Beautifully, blissfully, nothing! No capslock light coming on. No SHOUTING. Nothing.
But What IF I WANT TO SHOUT!
At this point, you’re probably asking yourself, “But what about Capslock?”
*F19::
If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 300)
{
If GetKeyState("CapsLock", "T")
SetCapsLockState, off
else
SetCapsLockState, on
}
return
Save it to a file called CapsLock.ahk. And then run it with AutoHotKey.
Now then, just double tap the CapsLock key, and, presto, that CapsLock light will beam its soothing green rays right into your eyes once more.
Double tap again to turn it off.
Hot Keys! Hot Keys! Hot Keys!
Ok, so getting the ability to shout again is nice and all, but there’s gotta be more than that.
And, Oh, there is!
That AutoHotKey app you’ve already installed? You’ve only just scratched the surface of what it can do.
How about making CapsLock work like the Ctrl key? Create another AHK script like this:
F19::LCtrl
Or how about CapsLock-N starting Notepad instantly?
F19 & n::Run Notepad
Or how about CapsLock-Insert appending selected text to what’s already on the clipboard
The sky’s the limit. Get familiar with AutoHotkey and you’re likely to find a ton of uses for it.
And with CapsLock now available as a completely new (and completely open) modifier key, you won’t have to worry about conflicting with the hotkey definitions of any other application.
Remote Desktop
I spend almost all day connected to remote machines via remote desktop. A wonderful follow-on benefit of this technique is that, since you’ve remapped Capslock on the host machine, even when you’re connected to a remote machine, Capslock will still map to F19, so the remote machine won’t see any CapsLock keypresses either.
It will, however see F19 keypresses. So, you have the option of deploying and running your AutoHotkey scripts on the remote machine, and they will see the F19 keypress exactly like scripts on the host machine, to be used in any way you see fit.
Lastly
If you’re still following along and all this sounds great, keep in mind that the ScrollLock and those number pad keys can all be remapped in the same fashion. Depending on your typically workflow, that may or may not make sense for you, but the process is exactly the same.
I’ve lamented Visual Studio’s lack of built-in macro support for ages. I tried a few extensions a while back but they never quite measured up. But I just stumbled across Text Macros for VS 2019-2022.
It’s perfect for a quick, one-off Record/playback macro, you can save macros, edit them (although that’s not ideal as the macros are saved in a rather obtuse XML format), and even assign them permanently to hotkeys.
It’s only good for text editing macros, so you can’t use it to “automate” Visual Studio itself, but I’ve yet to have a need to do that.
I’ve been using VSCode for quite some time now. Generally speaking, I’ve been super happy with it. It’s ultra configurable, fairly light weight, very fast, and just generally a pleasure to work with.
Except….
They completely got handling of Ctrl-Right wrong. Try it in Word, try it in Notepad++, in Visual Studio, you name it, they all work a certain way.
But VSCode, not so much.
Now, it’d be easy enough to get used to it, if all my editors decided to change the default way they handle Ctrl-Right. But, yeah, no.
I’ve dealt with it for a while now but this weekend, I finally decided to have a look.
It took some Google-foo, but eventually I came across this post by Spongman that very accurately describes the problem.
I won’t repeat that here, but here’s the keybindings for VSCode that fix the problem.