The Old New Thing

The redirection operator can occur in the middle of the command line

Although the redirection operator traditionally appears at the end of a command line, there is no requirement that it do so. All of these commands are equivalent: All of them echo "A B" to the file "C". You can use this trick to avoid the redirection problem we discussed last time. We saw that writing inadvertently interprets the "2...

Beware of digits before the redirection operator

If you want to put the string "Meet at 2" into the file "schedule", you might be tempted to use If you try this, however, you'll see the string "Meet at" on the screen and the "schedule" file will be blank. [Typo fixed, 10am] What happened? A digit immediately before a redirection operator modifies which stream the redirection operator...

Doing quick arithmetic from the command prompt

The command processor comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers: Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator. For more information, type at the command prompt...

The ForceAutoLogon setting doesn't do what most people think

The folks on the logon team wish me to remind you that the ForceAutoLogon setting does more than just log on an account automatically. They've had to deal with large numbers of people who set the key without really understanding what it does, and then getting into trouble because what they get is not what they expected. In addition to ...

Why do words beginning with "home" get treated as URLs?

Vitaly from the Suggestion Box asked (with grammatical editing), Could you explain why Windows starts the web browser if the file name passed to ShellExecute starts with "home". First thing to note is that this URL-ization happens only after the function has tried all the other possible interpretations. If a file named "homestar" is ...

The undeletable Outlook folder

For a while, I've had a few "undeletable Outlook folders". Even after deleting all the messages from them, Outlook just complains when I try to delete them. There was some sort of error message, but of course I didn't read it. The only option was OK, so I clicked it. As I recall, the message said something about "Can't delete because blah ...

Windows Server 2003 can take you back in time

If you are running Windows Server 2003, you owe it to yourself to enable the Volume Shadow Copy service. What this service does is periodically (according to a schedule you set) capture a snapshot of the files you specify so they can be recovered later. The copies are lazy: If a file doesn't change between snapshots, a new copy isn't made. Up...