DadOverflow.com

Musings of a dad with too much time on his hands and not enough to do. Wait. Reverse that.

Page 51 of 57

Saving time in Windows

I’m always trying to find ways to save time and working on the computer is no exception. At work, I do some work in Linux, but probably 95% of my computing time at work and at home is in Microsoft Windows. While I certainly do look to free and pay software to save time, Windows itself has a lot of nifty features that can cut down a lot of work time. Here are a few you might find helpful (NB: many of these reference the Windows key found on Windows-friendly keyboards, so I’d highly recommend becoming familiar with that key):

1. The Run Window (Win+R)

The Run Window is a great place to quickly fire up many applications you use without having to find the icon on your desktop or search through the Start Menu. Need a new instance of Notepad? Go to the Run Window and type “notepad”. Microsoft Word? Type “winword”. The calculator? Type “calc”. You can easily launch the Run Window with the Windows key plus R (Win+R) or by right-clicking on the Start Menu icon and selecting “Run” from the context menu.

2. Copy as Path

Often, I will need to have the full path to a file: say, I’m running an application and wish to open a file in it, such as an image or document. I could select the “Open” menu item and navigate through several folders to find my file. However, another option is to find my file in Windows Explorer, then hold the Shift button down and right-click on the file. A context menu will appear that includes a selection called “Copy as path”. This will copy the full path to your file in your clipboard. Now, you can paste that path in the “Open” dialog box and open your file more quickly.

3. “Cmd” in explorer

Sometimes I need to work with my files at the command line. I could certainly open a new command window by going to the Run Window and typing “cmd”, by then I would have to do a lot of change directory commands to get to the folder where my files are. Lots of wasted time. Alternatively, you can navigate to where your files are in Windows Explorer. Then, click in the address bar. The path to that folder becomes highlighted. Now, just type “cmd” and hit <Enter>. A new command window will open that’s immediately at your folder location.

4. Locking your computer with Win+L

When working on your computer, security should always be a top priority. So, whenever you get up and walk away from your workstation, you should lock your computer so that no one else can come up to it while you’re away and do nefarious things on it. The easiest way to lock your computer is the key combination of the Windows Key+L. I use this combination multiple times throughout the day.

5. Pin to taskbar

The newer versions of Windows allow you to “pin” an application to your taskbar. This way, an icon for your application will be permanently affixed to your taskbar allowing you to very easily launch the application when you need it. To pin an application to the taskbar, first launch it. You’ll see that the icon of your application now appears on the taskbar. Right-click on that icon. In the context menu, you’ll see a “Pin to taskbar” option, so go ahead and click that. When you close your application, the icon will remain allowing you to easily re-launch it. You can also move those icons around in case you want to group certain types of software together.

6. Open Windows Explorer with Win+E

I spend a fair amount of my computer time navigating around folders and files in Windows Explorer. You can launch an instance of Windows Explorer by looking for it in the Start Menu or you can even type “explorer” in the Run Window, but an even easier option is to click the key combination Windows Key+E.

7. Selecting files (or text) with either Shift, Ctrl, or both

As I alluded to above, I spend a portion of my computer time in Windows Explorer working on folders and files including moving them around. For instance, I’ll frequently download pictures and video off phones and cameras and move them off to my NAS and other storage devices. If I need to move all files from one folder to another, I can drag my mouse across all the files to select them all at once and then move them in bulk. However, what if I only want to move a portion of the list? That’s where the Shift and Ctrl buttons can help. Say I have 10 files in a folder but I only want to move the first 5. I can left-click on the first file then, holding my Shift key down, I can click on the fifth file and effectively select all the files in between. Now I can move all five at once. What if I only want to move the first, third, and fifth files? That’s where the Ctrl key can help. I can left-click on the first file, then, holding the Ctrl key down, left-click on the third and then the fifth files. This will surgically select just those three files allowing me to work with just those three.

The Shift and Ctrl keys come in handy with word editing, too. I tend to do a lot of editing of my kids’ various school papers. Much of my editing consists of removing and/or replacing whole words and sentences. You can do this sort of pruning with a mouse, but a mouse can be a rather clumsy instrument when performing surgery on that book report (not unlike a clumsy blaster). Instead, I’ll use the arrow keys on my keyboard to position the cursor in front of the word I wish to edit, then, holding the Shift key down, I’ll click the right arrow button across the word and simultaneously highlight the letters of the word one-by-one. If I want to edit the entire word instead of a few characters, I can hold both the Shift and Ctrl keys down together and then click the right arrow key once to highlight that word. I can hit the arrow key a second time to highlight the next word and so on. If I want to take out the entire line, I can click the Home button to position my cursor at the start of the line then, holding the Shift key down, click the End button to highlight the entire row. If I’m deep into a lengthy research paper and just want to get back to the start of it, Ctrl+Home will do the job; conversely, Ctrl+End will take me to the end of the document. Whatever you do, don’t forget to periodically Ctrl+S to save your modifications!

8. Copy/Paste alternative

Copy, Cut, and pasting (Ctrl+C, Ctrl+X and Ctrl+V) are Windows staples I assume most of you are already familiar with. Here’s a handy alternative, though. Suppose your kid writes, “to boldly go…”, and you decide the phrase should be “to go boldly.” With your mouse, double-click “go” to highlight the word then, holding your left button down, drag the word in front of “boldly”. You’ve effectively performed and pretty slick Cut-and-Paste operation.

Now, suppose your child is writing a retrospective on the fantastic Forrest Gump and decides to quote Private Bubba Blue: “There’s pineapple shrimp, lemon shrimp, coconut, pepper shrimp…”. Uh-oh: it’s coconut shrimp, not coconut. To fix this error of omission, double-click on the word “shrimp” used elsewhere. Normally, you might hit Ctrl+C then move your cursor to after coconut and click Ctrl+V. Instead, hold the Ctrl key down and drag your highlighted shrimp to just after coconut and then let go: you’ve just performed a nifty Copy-and-Paste. Neat, huh?

9. Ctrl+T in browsers

Admittedly, I do spend a lot of time in my browser. Like most of us, I take full advantage of tabs in our modern-day browsers. Need to open a new tab and don’t want to take your hands off your keyboard? Most browsers honor Ctrl+T as a way to open a new tab. Furthermore, once you open a new tab, most browsers will place your cursor directly in the address bar, so you can immediately start typing the url or search term you wish to execute.

10. Wheel clicking

I’m a big fan of mice that have a wheel between the left and right buttons. Wheels allow you to quickly scroll vertically in web pages, documents, etc. Most mouse wheels also allow you to click them like a button. What does this button do, you might ask? Well, the next time you’re in your browser, find a hyperlink and wheel-click on the link. The default behavior will be twofold: 1) a new tab will open in your browser and 2) the new tab will immediately navigate to the url on the link you clicked on. Nice little hack over what you’re probably already doing: right-clicking on the link then selecting “Open Link in New Tab” from the context menu. Now, try this: choose any tab in your browser (even one that doesn’t have focus), position your mouse pointer anywhere on the tab and then click your wheel. The default behavior will be to close that tab. This feature can help you quickly close all those tabs you’re done viewing. Many other tab-based applications, like Notepad++, also honor this behavior.

Music to drive by, Part 2

A while back, I posted about my challenges putting together a flash drive containing the music I’d like to listen to in the car when not listening to podcasts and so forth. Well, I’d like to offer an update on that effort.

In my original post, I discussed a script that first inventoried all my music then copied select mp3s to my flash drive based on whatever criteria I chose–in my example, my primary criteria was the song’s genre. In retrospect, I think it might be smarter to break those operations out into two scripts: one script to inventory my music and write the inventory to a JSON file and a second script to read that file, apply whatever filtering criteria I wish to apply, and copy the resulting mp3 files to a destination like a flash drive.

Create my inventory file

This script allows me to inventory my music and write it to a file. I’ll only need to re-run this script whenever there’s a change to my inventory. Having this file will, of course, allow me to proceed with the next step of this process–writing select files to my flash drive–but it will also help me figure out if I have music incorrectly labeled and it can also serve as a data file on which I can do some analysis later on. Here’s a snippet of the important piece of this script, but the full version is available on my Github page:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$music_folder = "$Env:USERPROFILE\Music"  # path to my music files
$dirs_to_exclude = "$Env:USERPROFILE\Music\soundclips"  # sub-dirs to exclude from the music collection
$mp3_collection = @()

# get a list of all the sub-directories containing MP3 files
$mp3_folders = dir "$music_folder\*.mp3" -Recurse | select Directory -Unique | where {$dirs_to_exclude -notcontains $_.Directory.FullName}

# now, loop through all my music folders to collect all the MP3s I want to process; store them in the $mp3_collection collection object
foreach($mp3_folder in $mp3_folders){
    $shell = (New-Object -ComObject Shell.Application).NameSpace($mp3_folder.Directory.FullName)
    foreach($mp3_object in $shell.Items()){
        if($shell.GetDetailsOf($mp3_object, 2) -like "MP3 File"){
            $mp3_file = [pscustomobject]@{'file' = $mp3_folder.Directory.FullName + '\' + $shell.GetDetailsOf($mp3_object, 0);
                                          'artist' = $shell.GetDetailsOf($mp3_object, 13);
                                          'album' = $shell.GetDetailsOf($mp3_object, 14);
                                          'album_year' = $shell.GetDetailsOf($mp3_object, 15);
                                          'genre' = $shell.GetDetailsOf($mp3_object, 16);
                                          'song' = $shell.GetDetailsOf($mp3_object, 21);
                                          'file_size' = $shell.GetDetailsOf($mp3_object, 1);
                                          'length' = $shell.GetDetailsOf($mp3_object, 27)}
            $mp3_collection += $mp3_file
        }
    }
    $shell = $null
}

# save collection to json object
$mp3_collection | ConvertTo-Json -Depth 5 | Out-File ($music_folder + "\mp3_collection.json")

Here’s an example of the JSON file the script will create:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[
    {
        "file":  "C:\\Users\\jdoe\\Music\\AC-DC\\Back in Black\\01_AC-DC_Hells Bells.mp3",
        "artist":  "AC/DC",
        "album":  "Back in Black",
        "album_year":  "1980",
        "genre":  "Hard Rock \u0026 Metal",
        "song":  "Hells Bells",
        "file_size":  "7.25 MB",
        "length":  "00:05:11"
    },
    {
        "file":  "C:\\Users\\jdoe\\Music\\38 Special\\The Very Best Of The A\u0026M Years (1977-1988)\\01 - Rockin\u0027 Into The Night.mp3",
        "artist":  "38 Special",
        "album":  "The Very Best Of The A\u0026M Years (1977-1988)",
        "album_year":  "2003",
        "genre":  "Rock",
        "song":  "Rockin\u0027 Into The Night",
        "file_size":  "7.56 MB",
        "length":  "00:03:59"
    },
    {
        "file":  "C:\\Users\\jdoe\\Music\\Billy Idol\\Greatest Hits\\03 - Hot In The City (2001 Digital Remaster).mp3",
        "artist":  "Billy Idol",
        "album":  "Greatest Hits",
        "album_year":  "2001",
        "genre":  "Rock",
        "song":  "Hot In The City (2001 Digital Remaster)",
        "file_size":  "7.16 MB",
        "length":  "00:03:32"
    }
]

Copying select files to my flash drive

My second script in this process will pull in my inventory file, apply whatever filters I’ve coded, and write the results to whatever destination I chose. Furthermore, I’ve added a check to limit the overall size of selected files by the size of the flash drive you’re using. Here’s a snippet of my code, but the full version is available on my Github page:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Convert-FileSizeToMB($size){
    $return_val = 0

    switch ( $size.split(" ")[1] ){
        "GB" { $return_val = [double]$size.split(" ")[0] * 1GB }
        "MB" { $return_val = [double]$size.split(" ")[0] * 1MB }
        "KB" { $return_val = [double]$size.split(" ")[0] * 1KB }
    }

    return $return_val
}

$music_folder = "$Env:USERPROFILE\Music"  # path to my music files
$mp3_col = Get-Content ($music_folder + "\mp3_collection.json") | Out-String | ConvertFrom-Json
$flashdrive_location = "C:\temp_music_folder"  # set the location of your flashdrive here
$flashdrive_size = 14250MB  # my song selections will likely exceed the size of the flash drive, so set that size limit here

# song selection criteria
$genres_i_want = "Metal", "Hard Rock &amp; Metal", "Rock", "Rock; Hard Rock &amp; Metal"
$bands_to_skip = "Mel Tormé", "Starland Vocal Band", "Burt Bacharach"

# apply my selection criteria and get a list of the songs to copy over to the flashdrive
$mp3s_to_write_to_drive = $mp3_col | where {$genres_i_want -contains $_.genre} | where {$bands_to_skip -notcontains $_.artist}

$size_of_files = 0
foreach ($mp3 in $mp3s_to_write_to_drive){
    if ($size_of_files -le $flashdrive_size){
        $size_of_files += Convert-FileSizeToMB $mp3.file_size
        Copy-Item -LiteralPath $mp3.file $flashdrive_location
    }else{
        break
    }
}

Unfortunately, this script runs quite long–at least, when I’m trying to load a 16 GB flash drive. In my experience, PowerShell just doesn’t do well with big I/O operations. If this gets too annoying, I may try to throw Python at the problem and see if I can get a better runtime.

Why am I going through all this effort when I should just be able to write my whole catalog to a large flash drive?

So, you might be asking, why are you doing all this hard work when surely your music collection can fit on today’s large capacity flash drives? First of all, don’t call me Shirley (sorry, couldn’t resist). To start with, my car seems to require FAT32 formatted flash drives. Once you get above 32 GB flash drives, though, it becomes difficult, but not impossible, to format such large drives as FAT32. I did this, in fact, some time ago. I took a 64 GB flash drive, formatted it to FAT32, and copied my entire catalog to it. It worked…kind of. Strangely, my car radio only recognized a fraction of all the songs I had on the drive. Then, after a few months, my drive more or less burned up and became unusable. So, I decided to go a less radical route and try to build a more selective process–the one described above.

Did I forget something?

Not to name names, but a certain family member occasionally forgets important items as he/she rushes out of the house at the start of the day. I, too, am not immune to such forgetfulness: from time-to-time, I find myself turning around a block or two from the house just to reassure myself that the garage door is closed or coffee maker is off or whatever. In an effort to reduce or eliminate these frustrations, here are some techniques I try to employ most mornings:

1. Keep your important possessions in the same locations

“That’s your home. Are you too good for your home?!”

Happy Gilmore

All your important possessions, work-related and otherwise, should have a home. Wallet, car keys, office badge, cell phone, etc. Designate a home for these items and keep your items in their homes at all times until you need them; otherwise, you’ll burn important minutes searching for your wayward items.

2. Make a checklist

After a third time of driving to my kid’s school to drop off a forgotten lunch–cutting into my work commute–I created a morning (and evening) checklist for each child, taped it to the refrigerator, and made each one go through it every morning. It worked for the most part. Such things should work for you, too.

3. Establish a sequence of events and make it a habit

I’ve established a set sequence every morning: make the kid breakfast, get changed for the day, unload/load the dishwasher, hit the bus stop, etc. Sticking to that order helps ensure I don’t forget anything important.

4. Establish a magic number

My magic number if four: 1) wallet, 2) keys, 3) cell phone, 4) coffee mug. Every morning, I count off these four items before I leave the house and every evening I count off these four items before I leave the office.

5. Verbalize when you’ve accomplished a task

If I’m not careful, as I start to pull out of my suburb or, even worse, onto the highway, I’ll start asking myself, “did I close the garage door?” Or, “did I turn off the coffee maker?” Arrghh! To conquer that second-guessing, as I close the garage door or turn off the coffee maker, I find it effective to say out loud: “I’ve closed the garage door!” Or, “I’ve turned off the coffee maker!” I will say these statements out loud to ingrain the fact in my brain. I try to make sure no one else is around to hear lest I scare the neighbors.

6. Set up alarms for yourself on your phone

I have a recurring alarm set up on my phone that goes on when it’s time to walk with the kid out to the bus stop. I have another set up weekly to remind me to take out the garbage (a snippet of The Coasters, Yakety Yak). Alarms are a great tool for remembering your responsibilities. Have some fun with your alarms, too. I highly recommend Zedge for downloading awesome ringtones and notifications.

7. Set up events and notifications in your calendar

The wife and I make heavy use of Google calendar for tracking all our events and activities. One helpful feature of Google calendar is event reminders: for any event you create, you can attach a “reminder” in the form of either an email or notification. For my more important events, I’ll select “notification” and then decide on when I need to be notified. If the event’s simply a reminder to do something–like call the cable company and threaten to cut the cord if they don’t lower my rates–I may want my reminder to be “on time”. If the event’s a dentist appointment for the kids, I might set it for 24 hours in advance so that I have time to clear my work schedule for that hour. When you’re on your laptop, notifications can be annoying; however, if you set up your calendar on your phone, notifications will usually appear in your system tray with a little chime and can be a helpful reminder tool.

8. Prepare the night before

Nighttime preparation is critical for a successful morning rush. Consider these techniques: A) pack up whatever items you can including lunches, school and work materials, gym clothes, etc. and places these items in their respective homes (see #1), B) perform whatever tasks you can the night before to lessen the morning rush including shaving and showering, choosing your clothes for the next day, etc. and C) rehearse your morning process the night before. Rehearsing your morning can be particularly helpful for unusual mornings, such as getting ready for a morning airplane flight, leaving early for a conference or college visit, and so forth.

9. Wear a watch

Am I showing my age by advocating wearing a watch? For a while, I tried the whole rely-solely-on-my-phone-for-the-time thing, but I don’t always have my phone with me or it’s inconveniently shoved in my pocket. A watch is a great way to keep you abreast of the time and help you stay on schedule, reducing the risk of forgetting tasks and items in the morning rush.

10. Get your kids (and/or spouse) to help

Your kids should be performing morning tasks, anyway: feeding and letting out the dog, unloading the dishwasher, packing their lunches, etc. Enlist their help!

« Older posts Newer posts »

© 2025 DadOverflow.com

Theme by Anders NorenUp ↑