When mentioning the registry, one thing comes to mind – fear.

Seriously! There seems to be a widespread thing about non-GUI components of the system. Even Microsoft advocates it.

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.”

What is it with this notion?!? Is 2012 going to be ascertained if we modified the registry?

Another example of mob psychology. An idea is proposed. It spreads like sneezers. Everyone gets infected.

That being said, the registry doesn’t get its notorious reputation without a solid cause. Two factors have contributed to this, namely:

  1. It’s the target of attack for viruses.
  2. It’s extremely delicate. (i.e. instruction to repair the registry are not followed. The next bit? Crash. End of that episode.)

Today, I really want to help clear its calumniations, through demystifying the registry in simple terms.

So, let’s get started.

First of all, what is the registry?

To put it simply, it’s a huge database. A database with a repository of values that Windows keeps to help configure applications and hardware.

‘whaaaattt….??’

It’s kinda like a custom record log kept up to date about your PC for your PC. It’s custom because everyone uses their PCs in a different way, so you’ll be hard pressed to find two completely congruent registries. And it’s kept up to date according to how you use it. So if you’ve just changed your desktop background, the next time it starts, it’ll load that background. So it houses values that are actively used in software programs and also by hardware.

That’s all!

So what’s the fuss about registries?

It’s usually okay when you leave it alone. But people get smart (who want to look smart) and try to tamper with it without knowing what they’re dealing with. Then you’re calling a disaster.

You see, there’s a widespread notion about tweaking PC performance online. One of the most popular (really, available) methods out there involves tweaking (euphemism for ‘messing with’) the registry. And when Windows updates your system, and you implement an outdated tip, irregular things start happening, depending on the key you change.

Caveat: If you want to deal with the registry, get educated about it, and you can go about fiddling with it.

Today, we’re going to have a look at the structure of the registry. And give some examples pertaining to that, and the next time (yes, this ain’t gonna be a one time thing – too long!), we’ll have a look at how to modify it and backup/restore.

Here’s a screenshot of the registry:

Now, the registry is what we’d call a flat database. To put that into perspective, if a database isn’t flat, it’s relational. That means there are commonalities between sets of data. So, for instance, a database for a movie club might have customers in both the rentals and the customers tables (a database is made up of tables primarily). The customer is a relationship to both databases.

A flat database has none. So, in other words, it’s just a table, sure, a really large one, but a table with rows and columns of data.

The Windows Registry is also hierarchical. So, you can imagine a tree of values and data, where the top level is the registry, the second level are parent branches, the third level are daughter branches, with the finalities marked by actual values.

Here’s a rough representation:

Here’s an example:

HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\jfmjfhklogoienhpfnppmbcbjfjnkonk
“Path” = sz:< C:\ProgramData\Real\RealPlayer\BrowserRecordPlugin\Chrome\Ext\rphtml5video.crx >

…where:

-          HKEY_LOCAL_MACHINE = Hive

-          Software = Key

-          Google = Subkey

-          Chrome = Subkey

-          Extensions = Subkey

-          Jfmjfhklogoienhpfnppmbcbjfjnkonk = Subkey

-          Sz = data type

-          C:\ProgramData\Real\RealPlayer\BrowserRecordPlugin\Chrome\Ext\rphtml5video.crx = value

This specific key refers to the file path where the real player extension library for Chrome is. Obviously, you couldn’t open it, since it’s encoded (probably written in C++?), but there it is.

We’re going to take a quick look at hives and data types. We won’t cover subkeys and keys in this post, since we aren’t going to explore the registry as in a reference book, but rather, gain a general understanding of how it works.

1. Hives

There are actually 7 hives together: 5 major ones, 1 depleted and 1 hidden in the registry. And we’re briefly going to go over each hive in turn. The letters shown in the brackets are just common abbreviations of the hive names…no biggie.

-          HKEY_CLASSES_ROOT (HKCR)

This hive mainly deals with applications on your PC. So, for example, things like file associations (you’d probably see a huge list of keys with common file types, followed by a huge list of application classes under this hive). If a Word file were to be open, Windows would reference the program used to open this type of files (.docx), and the application would launch.

To be more specific, for Windows 2000 and above, the following can be said:

HKCR = HKCU\Software\Classes + HKLM\Software\Classes

In other words, keys in this hive are a compilation of machine and user based settings for application programs!

Many subkeys are common to both subkeys. So if there are clashes, the HKCU\Software\Classes take precedence. Why? That’s simple. You want to see your personal settings on program applications, like what toolbars you enabled in a browser, desktop backgrounds, etc., and not the default settings.

-          HKEY_CURRENT_USER (HKCU)

This hive deals with settings that are specific to the current user. You might have noticed yet another overlap, that is, the overlap with HKU. That’s because, again, HKCU is actually a link to the subkey of HKU which corresponds to the current user. So, if John was logged in, the subkeys in HKCU would directly be taken from John’s key under the HKU hive.

On modern Windows versions (NT-based, to be specific), these settings are stored in two files called ntuser.dat and usrclass.dat (you can find them in the Documents and Settings folder in versions below Vista, and in the individual Users folders in Vista and above).

So, an example of a setting under this hive would be deactivating Aero. It’d then be stored under this hive.

-          HKEY_LOCAL_MACHINE (HKLM)

As the name suggests, HKLM stores settings that are specific to the local machine. You’d see a couple of overlaps between HKLM and HKCU, but again, when it comes to runtime, HKCU  values take precedence because they’re in context.

HKLM houses data on 5 main subkeys: Hardware, SAM, Security, Software, System. Examples of each:

Hardware: BIOS and keyboard settings
Software: software and windows settings
System: Hardware drivers and services

Now, SAM and security are protected hives, so they appear empty. To provide a brief overview, SAM contains user and group account data, and also security data for Windows NT/Server machines for the domain which the workstation belongs to. The security subkeys contains settings such as privileges, permissions and password rights.

That’s why Windows protects these two subkeys. Too important to be viewed by the naked eye.

-          HKEY_USERS (HKU)

Again, this is the aggregate of all the users’ individual settings on a local machine. HKCU references settings here.

One thing worth mentioning is that HKU and HKCU both support roaming. Any Windows Server domain with workstations joint to it can load user settings to any station through copying the file to and fro the server machine. And these hives play an important role in enabling the experience – that is, containing the configuration settings for each user.

-          HKEY_CURRENT_CONFIG (HKCC)

HKCC is yet another link to another key: HKEY_LOCAL_MACHINE\System\CurrentControlset\Hardware Profiles\Current. This hive deals with configuration data used by the current hardware set. Unlike most hives, this isn’t actually stored on the hard drive, but rather, it’s generated during runtime.

-          HKEY_PERFORMANCE_DATA

This key isn’t visible to us, and it deals mainly with performance data gathered from the kernel or running programs.

-          HKEY_DYN_DATA

This is the deprecated key. It used to store settings on hardware devices like PnP (Plug and play) devices, but is now unused.

2. Data types

If you haven’t done any programming before, data types is a topic of importance. Some programming languages are what we’d call loosely-typed languages. (e.g. Javascript). Others are what we’d call strongly-typed languages. (e.g. Java) Those who advocate the notion of data types are ‘strongly-typed’, and those which don’t are ‘loosely-typed’.

Simply put, writing a program involves defining variables. Those are properties of an object. For example, color, taste, time, etc. But variables are also required to fit into a specific category of data for the sake of executing algorithms. So, color might be a string, and time might be an integer. This is done so that distinctions are made clear. For example, color + time is an invalid statement because the types are different.

For the purpose of clarification, the Windows Registry also requires values to have a data type.

There are three things to take note of when mentioning data types in the context of the registry.

-          Value names have a limit of 16383 Unicode characters

-          There is an upper limit of 64K for all values under one key.

-          The table of registry accepted variables:

Yes, this is taken directly from Microsoft’s support site.

That about covers it for the ‘what’s’ of the registry. As to the ‘how’s’, that’s for next time.

So, thanks for reading, and come back for the follow up!

Stay tuned for the next post…

Demystifying the Windows registry (II)

VN:F [1.8.8_1072]
Rating: 7.0/10 (1 vote cast)
VN:F [1.8.8_1072]
Rating: +1 (from 1 vote)

If you remember just a while back, in the **‘PC fixes manual’, we lightly talked about a special directory that exists on windows that’s probably one of the most notorious ones on an average PC (…maybe apart from Desktop, but it’s a special directory, so it doesn’t count). And not without good reason. That is, if files in this directory are corrupted (corrupted meaning ‘wrong’ data, or data that’s not supposed to be), missing, replaced, you’ll know that your PC won’t function properly.

**If you haven’t downloaded it already, basically, it’s a handy manual that presents 9 common fixes available to all PC users. You can hop over to the right under the section ‘A small gift for you’ and pop in like, two lines of info, and I’ll send it to you right away. Cheers! XD                ——————————–>

So, what’s so special about this directory?

Well, let’s start with the basics.

A ‘directory’, a term that’s a remnant from the old days of DOS (which is now dead, incidentally), is simply another name for a ‘folder’. Basically, without the long technical details, a ‘folder’ is more graphical, and a directory…less so. You know how you double click (or single click) on a folder to view its contents? Well, in the old days, people used to type the ‘cd’ command (yes, there are superficial resemblances between the DOS and cmd, but DOS is dead) to access different directories.

Long story short, folder = modern day word; directory = deprecated, but still, accurate term.

Now, system32 is also a directory. It’s not any different in the sense that its structure isn’t outrageously demented, or it has a non-existent hierarchy or anything like that. It’s just a directory. But what makes it special lies in two major aspects:

1. That it’s a subfolder of a parent folder with an assigned environmental variable (%windir%).
2. The files it contains are essential Windows components.

I think I mentioned environmental variables somewhere else before on this site, hmm…I’m not too sure. In any case, they’re simply references to special locations which are used by software to locate a certain file.

Now, in the context of file references, there are two types of references that exist: absolute and relative. Absolute means that the folder path is just ‘as is’, e.g. C:\Users\Graham\Desktop. Relative, on the other hand, makes use of environmental variables to reference a location, e.g. C:\Users\%username%\Desktop.

To what end?

Put it this way – if environmental variables don’t exist, a program would have to hunt for different variables (values of things that change, like username, time, etc.) to string together (or concatenate) an absolute file path.

So, four things to take away here:

1. Environmental variables are references to special locations (e.g. %windir% = C:\Windows)
2. Environmental variables are always enclosed in percentage signs (e.g. %username%)
3. Environmental variables are used by programs to reference certain paths so they can find different files even when running on different computers
4. Environmental variables can be (for the most part) dynamic (e.g. %time%) or static (%SystemRoot%).

But that’s besides the point.

We really want to focus point no.2 from above, where it says that system32 contains some windows core components.

If you enabled file extensions to be shown (Tools à Folder Options à View à  Uncheck ‘Hide extensions for known file types’), you’d see that there are five extensions you see everywhere: .drv, .ocx, .dll, .sys, .exe.

These are all files containing libraries of core functions!

In other words, all programs that run on your PC are reliant on these files in order to execute.

So, what’s the point of this post?

Many times over, System32 is a popular target for attacks. Viruses commonly take the form of misspelled core components. So, for example, system32 becomes system32.exe. Now, with a little bit of digging, system32.exe is actually called the MARI Trojan which taps into sensitive data such as your credit card information, and sends them to a remote location.


So, in the context of protecting your system from virus attacks, the next time you suspect a virus infection on your PC, whether it be by latency, or strange errors (I’ve heard from a friend that some viruses can make letters drop from the screen, it’s super hilarious), try checking in the system32 directory, or implement Tip #5 from the ‘PC fixes manual’.

Of course, if all else fails, you can always resort to an antivirus program.

Thanks for reading!


Stay tuned for the next post…

Demystifying the Windows Registry

Thoughts, comments, questions? I’d love to here from you! Post them here.

VN:F [1.8.8_1072]
Rating: 7.0/10 (1 vote cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

*Before starting today, I’d just like to say, thanks for sticking with Rapid PC Fixes! The temporary hiatus is over, but I’m going to keep it at a hiatus level, that is, writing posts once every other day, and not as frequently as I planned in the beginning because of some other projects I’m juggling with. Well, enjoy!

Again, this post focuses on something the more conspicuous things we do on a PC on a daily basis, but without really noticing the more technical aspects of the operation, that is, copying and pasting.

Now, you might be thinking, ‘what’s the point?’. Well, really…there isn’t. But if we referred back to the original theme of the website, once we gain a better understanding of the operating environment that we use on a daily basis, then the process of fixing PCs, which I’m going to quickly outline below, will become much more apparent, simply because you understand how different software and hardware components interact with each other.

Diagnostics/troubleshooting (manually) involves the following process flow:

1. Problem surfaces
2. Attempt to locate the cause of the problem (theorizing and testing)
3. Temporary measure to isolate the problem
4. While temp relief is implemented, look to remove the problem’s roots
5. Verify that your PC works (in the sense that your fixes haven’t messed up other internal components and that the problem doesn’t re-surface)
6. Perform a list of common operations for final verification (e.g. rebooting, cold-booting, software installation, launching applications, using applications, etc.)

This is my attempt at generalizing the process. It’s not a ‘definitive’ process flow that must be followed or anything dramatic like that. Just a thought from an ordinary PC user.

But, again, I deviate.

So, let’s get started.

On an ordinary day, the weather’s quite dull outside. So, you decide to stay at home and finish off some work. And, you open up Word or Excel or any of the office application suites. You then open up your browser, whether it be Firefox or Chrome (I hope you’re using any browser OTHER than IE to view this… the only thing you should use IE for is to download Firefox or Chrome, [from http://www.makeuseof.com/tag/top-5-free-worst-microsoft-products-suck/]), and surf for information. Then, you start the duo sequence that we’re all only too familiar with: Ctrl + C and Ctrl + V. Whether it be a photo, a sketch or just plain ol’ text, anything we copy and paste into another application just magically appears before our eyes.

How?

Well, computer science isn’t magic. Everything has a certain logic behind it. Copying and pasting is no different. In fact, if you’ve copied and pasted over and over again in Word or any Microsoft Office applications before, you’re sure to have noticed this mysterious component that houses pasted objects: the clipboard.

Now, the clipboard looks something like this:

Or, like this:

Or, this:

Okay, so that’s how it looks. But that still doesn’t explain how it works.

Getting to the good part. Here it is.

The clipboard is simply a temporary location in your computer’s memory that’s used for the purpose of storing copied information! Now, I use the term ‘temporary’ to refer to the fact that all objects copied are erased from this location after you power off your PC.

It’s simply that.

So, how do applications access the data copied there? Through pre-defined programming interfaces. All this means is that programmers have specifically assigned a ‘paste’ function, or method to something, which is then accessible for the user to invoke this function. And that very something just so happens to be the keyboard shortcut ‘Ctrl + V’, not by coincidence.

So, why are we only able to access one copied object at a time?

Don’t ask me. The programmers at Microsoft decided that. But it’s also a logical decision, isn’t it? You don’t want, nor do you need a drop down menu of the hundreds of things to pop up when you just want to paste a URL from your web browser.

But, in some instances, it might be useful to be able to refer to multiple instances of copied objects. For example, you might want to copy many pictures for use on a medical research project for reference, and access them all at once, instead of alt-tabbing, copy and pasting multiple times. Computers are really useful for this, so let ‘em do the automation and batch processing!

Microsoft Office provides this feature. If you looked back to picture no. 3 above, you can see a list of things you’ve copied and access them from the clipboard, starting from the last item you copied (since it operates on a LIFO, or Last In First Out, stack basis).

So, that’s an overview of the clipboard.

But if you wanted to get very specific with the exact operations, then we can take this one level deeper. But I’m only going to lightly touch on this, for three major reasons:

1. I don’t fully understand how this technology works, nor have I ever designed applications using these interfaces.
2. I’ve never actually written something to do with this technology, so, I can’t present myself as an expert of this technology.
3. If you really want to understand this, you’d need a very strong background in programming, as well as the interactions between software instructions and their underlying hardware (OSI model), which are fully blown courses at university.

…so, for simplicity’s sake, let’s just have a brief look at what this is.

Copy and pasting are actually user-friendly terms, by my reckoning, since these are names of the actions that evoke underlying pieces of code to perform that function. The true process of this is actually embedding and linking. Now, they are by no means representative terms for these underlying technologies, nor are they more ‘right’ or accurate than copy and pasting, but that’s what Microsoft’s chosen to refer to it to, and we’ll be sticking with it.

The complete set of technologies that allow the interchange of data between applications is called OLE, or Object Linking and Embedding, a wide range of code libraries developed by Microsoft to allow the two actions denoted by the name, linking and embedding, to be accessible to users through the interfaces in different applications.

It’s actually smarter than just enabling simple copy and pasting. If we think of this from a simple point of view, copy and pasting can involve the fashion by which the operation can be carried out, the exact process of data interchange (e.g. what to copy, how to copy, format conversion, etc.), what can be copied (definition of objects), etc.

So, the things that we take mostly for granted today, like drag and drop operations, simple copy and pasting, or even more complex data interchange such as interactive charts ‘synced’ between Excel and Word, are completely based on Microsoft’s OLE technology, which started all the way back in 1990’s, and were contained in two files olesvr.dll, and oleclt.dll. Two files! Seriously, sometimes, you just can’t help marvel at the beauty of technology and the conveniences it’s brought us.

Notes

Note: Whoops, forgot to mention this, when talking about clipboards and such, copied things are referred to as ‘clips’. :D

Note 2: Here’s another cool tip – if you’re familiar with the basics of cmd, you can use the redirection and pipe symbols to redirect things to and fro the clipboard! For instance, if you wanted to copy a file’s contents to another place, but aren’t bothered to open it up, you can do the following:

1. Use ‘cd location’ to go to your file’s location
2. Rename your file to a .txt extension
3. Type in ‘filename | clip’ (the middle line is a ‘pipe’ symbol)
4. Ctrl + V to wherever you want to paste your document to.

Have fun!

Note 3: If you’re using Windows Vista or above, you won’t be able to access the clipboard and view its contents. Now, there are two ways around that:

1. Copy the clipboard viewer (a file called clipbrd.exe) from XP to Vista/7.
2. Download this great freeware to perform some advanced clipboard-related operations: http://www.clipmagic.com/software/cmsetup.exe .

That’s about it for this time, thanks for reading!

Note 4: Cool stuff

Great clipboard tricks – http://lifehacker.com/software/lifehacker-top-10/top-10-clipboard-tricks-281181.php


Stay tuned for the next post…

The most notorious directory in Windows

Thoughts, questions, comments? Post them here!

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Hey guys!

Thank you for reading this blog up till now. However, this current ‘project’ (*wink*) of mine doesn’t meet the…necessary criteria. This all sounds cryptic, but I’ll explain in full once I get this blog running again.

So, for now, my marketing endeavors will keep me busy for now. I might occasionally do a post here and there, but I won’t be as consistent as doing this on a daily basis. However, of course, once I finish this one-off project, it will give me more time, resources, and hopefully, knowledge at maintaining/developing this blog, and deliver much better content to you guys (/gals :D ).

Once again, thank you for the viewership, and I’ll do my best to get back to this as ASAP.

Regards,

Baggio. :D

(Note to myself: Where I left off…

1. Updating freebies
2. Updating Wish list
3. Post per day
4. Screencast series)

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Hey guys!

I just wanted to drop in a quick line to say sorry, sorry for not being able to post today (12.02.10) and tomorrow (13.02.10).

Today, I witnessed the ceremonials that are due for my now deceased uncle. For the last time, I got to see his face in the Chinese morgue. How peaceful he appeared. As if he was merely in a deep slumber. How much I wished that was true. When I watched him from afar, it was like expecting him to stretch, yawn, kick the covers off, and go to dinner together. Alas, if that were to happen after dissection, it would have been a miracle.

Yeah, we’re still waiting for the coroner’s report. At the very least, we should know what took him. My aunt, who was there to witness the terrible incident, who discovered uncle laying dead 6 hours after (he passed away in his sleep), said that the previous night, he made comments several time about cardiac pains, but didn’t ask for any medical attention.

Tomorrow’s the big day. Cremation. That marks the end of my Uncle’s journey as a mortal, perhaps passing on to the afterlife.

Here, I’d like to say just this to my beloved Uncle Matthew:

‘Make sure you have loads of fun, invite your friends over for a round of mahjong if you’re bored, eat your favorite foods if you want, play as many MMORPGs as you like. Don’t worry! Just be happy.’

Strange message for a deceased relative. But for one who’s always an optimist, a zealous, gregarious optimist, who had so many great ideals, never had the trouble of making people feel better, perhaps this is only fitting.

May the blessings of the gods be with you.

Rest in peace knowing that you’ll always have a special place in our hearts, mine included. Thank you for all the precious time we’ve spent together. Thank you for always hanging out with us when we needed company.

Thank you.

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Here’s a thought. Why not do a series of posts to do with common fixes, so users can easily reference this? And we can make this as detailed as it needs be, so it’s a perfect solution! Instead of writing the solution everytime you need to answer a question, you can just point them to a specific entry…

Fun!

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Hey guys!

Today, we’re going to take a small break from using Windows admin tools. Instead, we’re going to focus on one thing that’s quite widespread, and used very often – that is, taking screenshots.

So, what’s the mystery behind it? I mean, all you do is to press ‘Fn + Prt Sc’ (might vary depending on the PC manufacturer), and the screenshot’s taken, right? Or is it?

Let’s take a quick look below.

Let’s just say, for instance, you want to take a screenshot of…the command prompt.


And you get this.

Now, let’s say you want to crop it to fit in your document, so you’d typically crop it in an image manipulation program like Fireworks, Photoshop, or, if you aren’t accustomed, simply in Word.

And you get…this.


See what’s wrong?

The corners are showing the desktop background!

Okay. Let’s say you’re using XP, and you don’t have Aero. So what then?

You still have rounded corners!

And, as we know, it’s just tedious to use marquees and the magic wand just to remove the tiny pixels in the corner. It’s not so inconspicuous that you can’t see it, but not so noticeable that it annoys the crap out of ya.

So, what do you do?

Normally, I wouldn’t bother with such a trivial problem, unless, of course, there’s an easy workaround to this.

There is.

Compare the above screenshot to this.


See the difference? I didn’t use anything like marquee + eraser, magic wand, white polygons to cover up corners, or anything lengthy like that. All it takes is for ONE more step in taking a screenshot.

So, how’d we go about doing it?

Here’s the trick.


Sorry if you were expecting something more. Nope, that’s just it. Just put an empty instance of Notepad behind your application window, and you’ve got perfect corners!

Obviously, this is going to be applicable to white backgrounds. So, if you’re uploading and placing the photo in front of a website with a pink background, it’s not going to show up pretty (not that there’s anything wrong with pink, of course).

So, another question might have popped up by now.

‘What if I want to take screenshots of Windows components, e.g. Start menu?’

The principle’s the same. All you have to do is to…

  1. Find out your monitor size.
  2. Go to an image editing program that supports vector shapes (i.e. shapes that don’t get distorted/pixilated when you resize them, unlike photos that lose their quality when enlarged).
  3. Draw a rectangle of exactly the same size (I’d go a bit further and make it a little bigger just for insurance).
  4. Fill it with white.
  5. Save it in a folder where you stash all your images.
  6. Right click Desktop à Personalize à  Desktop background.
  7. Change it to the photo with the white rectangle.

Then, you get nice screenshots without any anomalies!

But, there are some instances where you do want to take screenshots with rounded corners, transparent windows (Aero), where you do want to place in front of colored backgrounds.

The solution?

I’ve found this software to be pretty handy in this case. It helps remove all the complicated stuff like removing corners of screenshots, enabling transparency, etc. All you have to do is to open up the windows you want to capture, open up this program, and select ‘Capture’.

Again, I advocate for free stuff. The Internet’s grown so rapidly because it operates on an open basis. That encourages freeware. Lots of them.

So, here’s the download link:

Download 7Capture here

Thanks for reading and stay tuned for the next post!

Thoughts, comments, questions? Post it here!


Up next…

Where do vanished objects go?

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

Howdy!

Do you guys remember what we talked about yesterday? About adding a to do list (drafted in notepad) to pop up during startup? Well, good news is, there’s a much more elegant solution to do this! Is it easier, though? Not necessarily. In fact, I’d surmise yesterday’s method would be the most straightforward. But, if you’re used to using graphical interfaces, this will definitely be more comfortable for you!

The solution we’re talking about today is using another one of Window’s pre-built configuration interface, that is, Task Scheduler.

This is one of Window’s lesser heard of tools to the general populace. That is, I don’t think you’d actively go looking in the System32 directory for system info unless you need to understand the components within. But again, we’ll leave that discussion for another time, since it wields such enormous power over Windows.

So, what is task scheduler?

Here’s a picture of it:

Yup, this is task scheduler. Plain, simple, but effective.

Task scheduler is a utility Microsoft ships with its Windows operating system that allows users, as the name suggests, to schedule tasks at predefined intervals or times. A fancy way of saying ‘automating things to be done at a certain time’.

Without the tedious explanations, let’s have a look at how it works.

First of all, tasks are ‘split’ into two levels – basic and standard.

If you had a look in the right hand pane of the console, you’d see that there are two ways to create tasks: ‘Create basic task’ and ‘Create task’.

For general tasks, like initiating a program at startup, or displaying a message, the ‘Create basic task’ option’s enough. All you have to do is to follow the wizard, select the options, and you’re done defining the task.

It’s actually kinda like lightweight programming, all in a graphical interface.

1. First, you describe the task. (Class definition, defining properties, initializing variables)
2. Second, you define a trigger. (Conditional statements)
3. Then, you define what happens. (Writing the actual function)

Doesn’t it sound like programming?

Of course, if you wanted more precise control over how a task is carried out, you can always go for the ‘Create task’ option. It’s not that much different from the ‘Create basic task’ wizard, but if offers more versatility and options in controlling your task. Here’s a quick list of extended features you can control in the ‘Create task’ option:

1. Task delays
2. Task repetition
3. Task expiration
4. Synchronization across time zones
5. Wake computer to run task
6. Start on AC power/battery power
7. Start only when specified network connection available
8. Run task ASAP if session missed
9. If task fails, restart frequency
10. Task kill if it goes on for more than specified time
11. Force quit task if it doesn’t end if requested
12. Control multiple tasks to be run simultaneously, queued, kill one process before the other…etc.

So, as you can see, with the above options (and more that I haven’t mentioned), it indicates the power of task scheduler brought to the ordinary user like us.

Obviously, there is both a command line equivalent and a command line counterpart to schedule tasks, although Microsoft doesn’t recommend it. We’re just going to briefly have a look at it, because anything you can do with the command line, can be accessed in task scheduler, with a much more user-friendly interface.

1. Command line equivalent

Because I don’t dual boot, I only know that this command is available in Vista, and certainly for Windows 7. As for XP, I wouldn’t use any absolutes lest frustrating and disappointing readers.

Windows has built in the command ‘schtasks’, which does exactly the same thing as the graphical equivalent. So, why does it exist? I mean, it must have a purpose of existence, right? On the top of my head, speed, recursion (task scheduler calling itself to run something?), just for the sake of it, in that order.

The syntax is fairly simple, “schtasks parameter [arguments]“, but specifying the parameters and arguments is an onerous task, and takes some practice to master. To print a list of commands to learn, you can use append the output of the file to notepad like this:

schtasks /? > schtasks.doc

2. Command line counterpart

I think we’ve mentioned it before in the post ‘Tech #1: The command line…why does it exist?’, but only ever so slightly. If you wanted to schedule a task to be fired on a time-based trigger (i.e. you want sth. to happen at x:xx o’clock), you can use the ‘at’ command in cmd.

at \\computername /interactive /every:date /next:date command

So, for example:

at 16:00 cmd /c copy abc.txt C:\Users\%username%\Desktop

The downside of this, of course, is that the only trigger available is time. You can’t specify a task to be executed during startup, login, or switching from AC to battery power, for instance.

So, whether you’re the super organized type, or the less organized type, this is a great way to remind yourself what to do, do some housekeeping tasks and file management – all automated. Why wait to use a calendar, when a simple message does the trick? (Besides, most calendars don’t allow alert messages to pop up during startup – this is a nice way around it!)

Thanks for reading this!


Up next

How to take perfect screenshots

Thoughts, questions, comments? Post them here!

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)

This marks the beginning of a new series on Rapid PC Fixes. Apart from the toolkit and tech series, I’m also going to start a new series to deliver tips. Hopefully, when my timetable isn’t so sporadic, I can write a tip everyday, and post it up here, and hope you guys can learn a thing or two.

Enough with the pep talk, on with the content!

Startup. The most common association that it has is the context of optimization. That is, a list of configuration settings that users can modify to make their PCs run faster.

Sadly, startup programs often have negative connotations. We don’t think about startup programs without also assimilating it with latency, or lagging, in colloquial terms. So, apart from disabling startup services from microsoft’s MMC to speed up boot times, I’d like to share another use of startup today.

This actually dates back to when I was learning about batch files not so long ago, batch files meaning a file containing a set of commands to be executed by cmd in sequence. So, for example, you might have a very common script to clean up temp files on your local hard drive. Instead of typing the command every time you wanted to do a temp file cleanup, you can simply automate this task using the ‘at’ and ‘del’ commands, and it’ll run.

In fact, I was trying to do something similar. Because I’m the ‘featherbrained’ type in general, I wouldn’t remember what I had for breakfast this morning, let alone the stuff I was working on yesterday. So, I thought, is there a way to display a text file containing a to-do list for tomorrow that will show during each startup?

So, with a bit of diggin up in the Internet, I found my answer. Yes, you could. And the good news is that, you don’t have to use to command line to do it! (My assumption was that there was a special environmental variable (those are placeholders used by programmers for convenience in referencing, e.g. %username% corresponds to the username of your Windows account. You can try it by typing ‘echo %username%’ in cmd.) corresponding to ‘during startup’. But, as it turns out, it’s actualy much simpler than that.

If you had a look under All Programs, you’d find a mysteriously inconspicuous directory called ‘Startup’. The full path of it can be realized here at “C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”. I’m using Vista, so I’m not sure if it’s any different in XP or Windows 7, but it should generally be located in your All Programs menu.

So, if you ever feel the need for reminders, you can easily add a to do list in a simple text editor like Notepad, then copy and paste the file in the Startup directory to pop it up during every startup.

Conversely, if you’ve got a bit of experience using cmd, you can always write a batch file like

@echo off

cd “Enter directory where you’ve saved your text file”

copy %1 [Placeholders stand for your file name] “C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”

echo File successfully copied!

pause

So, all you’d do is you’d is the following:

1. Go to cmd with administrator privileges
2. Type in cd “path where you saved your batch file”
3. Type in ‘name of your batch file’ ‘filename’ (which corresponds to the %1 placeholder, which stands for your file name)

So, if the name of your batch file is ‘test.bat’ and the name of your text file is ‘todo.txt’, you’d type in

test todo.txt

Have fun!

That’s about it this time. Expecting something more? Well, if we spilled the beans about the best optimization strategies, productivity tips and diagnostics tell-tale signs, there’s nothing more to write tomorrow. Seriously. If you knew that Voldemort was going to die in the end, would you bother reading until the end? The answer’s probably, ‘yes, but with less anticipation. (*Hint hint: because we already know the most exciting part.)’

So, thanks for reading this, and stay tuned for the next tip!

Oh yeah! If you’ve got any ideas, thoughts, questions, feel free to post it in the comments area here!

Or, you can just if it a star rating below (and a thumbs up rating – love the color scheme, btw)…

Thanks!


Upcoming tips…

1. A more elegant solution – using task scheduler
2. Taking perfect screenshots

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: +1 (from 1 vote)

I’m sure you’ve all seen this scary looking screen before, and wondered what is it, or what it does.

Well, I’ll provide an overview here.

(Okay, for you busy folks, here’s an abbreviated definition: cmd.exe – An alternative environment extensive non-graphical program that allows users to execute commands to manipulate, change or modify data based upon the utilities an operating environment provide.)

MS-DOS

For older folks here, you’d probably remember the MS-DOS’s reign in the PC markets then. Here’s a picture if you don’t know (or have forgotten) what it is:

Doesn’t it look remarkably similar to the command prompt?

Despite the extreme closeness in appearance and commands, they’re two different entities. MS-DOS has long ceased to exist, ladies and gentlemen, that much is a fact.

In fact, you can find a great argument about it here: http://commandwindows.com/command1.htm

Short, but precise.

Back to the point, natively on Windows NT systems, a command line tool exists for users to carry out administrative tools (more on that later). Windows used to have two of these, COMMAND.COM and cmd.exe. The former’s dead, and the latter’s still with us today? Why, well, COMMAND.COM’s only purpoes was for compatibility, while cmd.exe had much more versatile commands that supported 32-bit processors. Okay, fine, I missed out PowerShell, which is available for download on Microsoft’s website here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=7c8051c2-9bfc-4c81-859d-0864979fa403&displaylang=en

A bit of Microsoft OS history: MS-DOS came first, then the Windows NT family (2000, ME, XP, Vista, and some older systems.) MS-DOS = scary looking black screen with white text + unfamiliar naming conventions. Windows = Nice looking graphical environment, understandable at a glance.

Literally, Windows has replaced MS-DOS. With its rich graphical user interface (that’s GUI for short, pronounced ‘GW-EE’), and a truly user-friendly display of WIMP power(Windows, Icons, Menus and Pointers), it’s no wonder that MS-DOS has fallen out of favor in the OS market during the early 1990′s. So, why is its legacy still lingering around in these brand new systems?

Well, simply, things don’t exist without a reason. At least, that’s my philosophy. As with ancillary service providers (like your ISP is to your PC, or that repair shop to your cars), Windows has its own CLI because there are simply some things that you can’t do on a user interface that’s available to you…in that scary looking screen.

It’s not just for administrators. Ordinary users might have stumbled upon the usefulness of this administrative tool, because of its terse execution, and efficiency at carrying out multiple tasks, in the form of scripting.

Microsoft has already provided many GUI equivalents to commands in cmd.exe, but again, it’s much quicker to utilize the non-graphical equivalent when you’re familiar with its syntax, structure and the operating environment.

For example, the command ‘shutdown’ offers this as an alternative.

While much clearer what we can do as users to initiate a shutdown, it’s slower. Not very noticeably, I might add, but still, slower.

Another example would be the non-feasibility of repetitive actions. If you’d just taken 100 photos on your vacation to Japan and transferred them to your hard drive, you’d have to spend quite a bit of time renaming them. In fact, before I became aware of the power of cmd, I once spent hours doing this myself. Right-clicking each photo, and renaming each in turn. Of course, now that I became aware, it’s much easier to write a batch file to loop 100 times and output a corresponding name (what does that take? 2? 3 lines). Doesn’t even need user input! (This, of course, is based on the assumption you’re going to name them something like ‘Japan001′, ‘Japan002′…’Japan100′, and not ‘Sakura’, ‘White sun!’, ‘Slipping on the wet pavement’).

Further examples of its versatility includes housekeeping tasks, such as scheduling disk checks during start up, cleaning temp files on set intervals, defragmentation, checking system file integrity, etc.

Such functions of Windows are often neglected, of course, which is why it’s not a widespread tool. In fact, when referring to the term ‘PCs’ or ‘computers’, we often associate with using application software that runs on top of the operating system, and not the system itself. After all, if all I needed to do to surf the web is to open up a browser and type in some words, why would I care about the integrity of system files?

The point is, though, the possibilities of using cmd are endless. If you had a look at the available commands at your disposal, it would simply strike you that Windows is a truly outstanding operating system that provides you so many ways to utilize the platform. True, Aero’s a target of criticism since Vista was released, but if you have a look at its history, how it evolved from MS-DOS (1981) to a fully fledged graphical experience in Windows 7 (Oct 2009), it does put the latency in perspective, doesn’t it?

Microsoft has always been the center of attacks because of its monopolistic practices (okay, fair enough), which attracted many, many programmers to exploit its flaws, creating the illusion it’s a vulnerable system prone to the smallest bug. Well, I’ve got news for you. It’s not easy to manage 40,000,000 lines of code. Okay, you’ve got the argument of streamlining code to make it more manageable, but seriously, until time constraints, and such heavy commercial usage, the objective is to enhance upon its existing code base, not to revamp. Think about it, if Microsoft announced it was developing a new operating system to attempt to downsize its operating system in time to take over its currently OS, what horror would that unleash for software developers? Unthinkable.

But, getting back to the point, you should now be able to see why there’s value in spending a bit of time learning about cmd. Even if not learn about it, you should at least become familiar, or even appreciate its existence. That is, it’s the hidden power extension of Windows as an operating system. Speed you gain from familiarization is just on the surface. If you bring it up a notch, you can gain so much from automation by writing batch filees, earning yourself the respective rank of a ‘power user’.

Scripting

In fact, many people who mastered scripting can find many utilities of it outside the realm of Windows, and, with the experience as a precursor, move on to higher level scripting and programming languages.

Hey, guess what? If you’ve ever wanted to do something like this, this is VERY MUCH within your reach! Yes, I don’t doubt that it’s going to take time, but with the right direction, it is possible to become more sophisticated than your average PC user.

In fact, it’s in your interest to learn about the more advanced features of computers, since I allude to the cyberworld to the shrinking middle class. Think about it. At one end of the spectrum, you’ve got the average PC user who’s generally comfortable with using graphical components to manipulate data, and perhaps, had gone to a more explorative state and looked at some of the operating system’s advanced features. At most, that puts ordinary users like ourselves in a ‘sophisticated novice’ category. At the other end of the spectrum, you’ve got programmers who have a complete grasp of the interaction between various components of the computer system, and creates applications that allow users to extrapolate upon the underlying function provided by the operating system.

What’s the middle class?

The future

Well, it’s disappearing. Literally. As technology becomes much more advanced, some emerging trends include the world wide web, then subdivisions include AJAX, jQuery, P2P software, (really, we’ve seen this coming…best example – social media’s taking over, or really, merged IM-ing with the web) it does place a much greater gap between the two classes of users, and a correspondingly fortified barrier to transition.

What does this mean for you?

Start learning things about your PC today. No matter how many years, decades or centuries from today you’re reading this, it stands true. It’s absolutely essential. For a brighter, more efficient tomorrow, learn as much as you can and integrate it with your life, since, alluding to the old, perhaps cliched Chinese aphorism, ‘A journey of a thousand miles start with a single step.’ Eventually, through consistent application of your learnings, you’ll become much more proficient at using the PC as a productivity tool.

The best of luck to you!

And…to truly answer your question, cmd.exe is evidence of the legacy left behind from the days of the MS-DOS, which exists to provide command-line tools for administrative purposes.

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)