Dave's Tech Blog
Archive for January, 2010
Funny Comedians
Jan 29th
Not true for me but pretty funny… Marriage bit:
Mormon Funnies
Mormon Mission
Deer Hunting
Powershell
Jan 27th
One of the most important first steps to know about powershell is how to disable the security policy so you can just get into learning it. This command:
Set-ExecutionPolicy Unrestricted
will disable the default security policy.
Some introductory examples to get your feet wet (copy one of the two below lines from the browser then right click in the windows power shell run time to paste):
get-EventLog system -newest 2000 | where {$_.entryType -match “Software”}
get-EventLog system -newest 2000 | where {$_.message -match “Software”}
Here is how you find out which processes have been started in the last hour (both lines on code below):
$1HourAgo = [DateTime]::Now.AddHours(-1)
Get-Process -computer spkwrkdaveh |where {$_.StartTime -ge $1HourAgo}
This command gets all of the errors in the Windows PowerShell event log that occurred in June 2008 (all three lines on code below):
$May31 = get-date 5/31/08
$July1 = get-date 7/01/08
get-eventlog -log “Windows PowerShell” -entrytype Error -after $may31 -before $july1
If Statement
As with so many PowerShell constructions, the type of bracket signifies how to break the script into sections. It is worth emphasising that (parenthesis are for the first part, the condition), while {braces are for the block command}.
If (condition) {Do stuff}
or an alternative explanation would be
If (test) {execute if true}
$Number = 10
if ($Number -gt 0) {“Bigger than zero”}
Learning Points
Note 1: Trace the construction and separate into: if (test) and {what to do}.
Note 2: Avoid over-think; there is no ‘Then’ in PowerShell’s ‘If’ statement. My advice is that instead of worrying about ‘Then’, pay close attention to the two types of bracket.
Note 3: To double check your understanding, try amending, “Bigger than Zero” to a different text string, such as: “Less than nought”. Once you have done that, set $Number to -1.
Example 1a File Content Example of Plain ‘If’
PowerShell has a batch of help files. One of these files contains help about the ‘if’ statement. In the example below, $File references that file. $Content is set to the content of the file. The third line attempts to match a string to the contents of the file.
# Help on PowerShell’s if statements
$File = get-Help about_if
if ($File -match “The if Statement”) {“We have the correct help file”}
Learning Points
This example is concerned with matching a string “The if Statement” to the contents of a file.
# Help on PowerShell’s if statements
$File = get-Help about_if
if ($File -match “The if Statement”) {“We have the correct help file”}
Else {“The string is wrong”}
Learning Points
The best way to see how ‘else’ operates is to amend line 3 thus:
($File -match “The ifzz Statement”).
Example 3 ElseIf
This example has a real task, and that is to check that we have the name of an actual file.
# Help on PowerShell’s if statements
$File = get-Help about_if
if ($File -match “The if Statement”) {“We have the correct help file”}
ElseIf ($File.Length -lt 1) {“Check file location”}
Else {“File exists, but does not contain text string”}
Learning Points
Note 1: The advantage of ElseIf over plain Else, is that we can introduce a new test. In the above example we use ElseIf to check if the length of the file is less than 1. To activate the ‘ElseIf’ block, set $File to a non-existent file for example
$File = get-Help about_ifxx.
Note 2: To trigger the final ‘Else’, try changing:
$File = get-Help about_if
to
$File = get-Help about_scope
If you have time, you could add more ‘ElseIf’ statements to cater for other eventualities. Alternatively, if the ElseIf construction is getting unwieldy, then try the superior switch command.
PowerShell Switch
A curious feature of the construction is that the word ‘Switch’ introduces the input, and is then never seen again, all that you see thereafter is rows of patterns and matching {Statement Blocks}. Also observe that there is an extra pair of {braces} surrounding the whole pattern section.
The layout below emphasises the branches, or the multiple ‘Patterns’ whose values get switched to their respective {Blocks}.
Switch (pipeline) {
Pattern 1 {Statement block}
Pattern 2 {Statement block}
Pattern n {Statement block}
}
For simple examples, you could write the Switch command all on one line:
Switch (3) { 1{ “Red” } 2{ “Yellow” } 3{ “Green” } }
Result Green. PowerShell switches the input 3 for Green.
Learning Points
Note 1: Trace the overall structure of the Switch command:
Switch (Value, or Pipeline in parenthesis) {Actions in braces}
Note 2: The “Block” for each Switch is enclosed not only by {braces}, but also by speech marks { “Yellow” }.
Note 3: Remember to pair the initial { brace, with a final matching brace, even if the whole structure spans multiple lines.}
A difficulty occurred when we interrogated the computer’s disks with WMI. Specifically, the output reports DriveType as a number, whereas we want a meaningful name for the type of disk. The extra step in this example was to research which drive type corresponded to which number, for example if $Drive.DeviceID returns a value of 3, that means the disk type is a “Hard drive”.
Case Study 1 – Problem with output
# Case Study 1 – Problem
$Disk = get-WmiObject win32_logicaldisk
foreach ($Drive in $Disk) {
$Drive.DeviceID + $Drive.DriveType
}
We want an answer to the question: ‘What does the DriveType number mean?’ It would be useful if the script gave us a name rather than a number. Research reveals that there are at least 5 possible disk types, therefore multiple ‘If’ statements would be cumbersome, ‘Switch’ is more elegant.
Case Study 2 – Solution with ‘Switch’
# Case Study 2 – Solution with ‘Switch’
$Disk = get-WmiObject win32_logicaldisk
foreach ($Drive in $Disk) {Switch ($Drive.DriveType) {
1{ $Drive.DeviceID + ” Unknown” }
2{ $Drive.DeviceID + ” Floppy” }
3{ $Drive.DeviceID + ” Hard Drive” }
4{ $Drive.DeviceID + ” Network Drive” }
5{ $Drive.DeviceID + ” CD” }
6{ $Drive.DeviceID + ” RAM Disk” }
}
}
Learning Points
Note 1: Before examining the solution in Case Study 2, take the time to understand the underlying WmiObject construction in Case Study 1. In particular observe the format:
foreach (condition) {Block Command}.
Note 2: The case study solution builds on the first script by adding the Switch block. To my way of thinking, there are two loops, the outer foreach and an inner Switch loop. Check what I mean by matching the last two {lonely} braces with their opening counterparts.
Challenges
Challenge 1: Just to get experience and control of the script try changing “Hard Drive” to “Fixed Disk”
Challenge 2: Create a mapped network drive, then run the script again. Launch Windows Explorer then click on the Tools menu, this is the easiest way to map a local drive letter to a UNC share.
Learning more about PowerShell’s Switch command
When I wanted help about the switch command, at first PowerShell’s help did not do what I wanted. The secret was to add the about_ prefix. Try:
help about_switch
What the about_switch help file reveals is that you could use wildcards in the matching clause.
Incidentally, PowerShell supports a whole family of about_ commands, for example you could try:
help about_foreach
Case Study 2 – Featuring Switch with -wildcard
Case Study 2 – Count the types of error message in the Application eventlog
# PowerShell script to count eventlog messages
function EventType{
BEGIN {
$errors = 0
$warnings = 0
$info = 0
}
PROCESS {
switch -wildcard ($_.entrytype) {
“err*” {$errors++}
“warn*” {$warnings++}
“info*” {$info++}
default {}
}#switch block
}#process block
END {
“The Application log contains ” + $errors + ” error messages.”
“The Application log contains ” + $warnings + ” warning messages.”
“The Application log contains ” + $info + ” information messages.”
}#end block
}#function block
get-eventlog “application” -newest 250 | EventType
Note 1: Observe the -wildcard switch with err*, info* and warn*. To test the effect, try removing the -wildcard parameter.
Summary of PowerShell’s ‘Switch’ command
The ‘If’ family are easy to use for scripts that require branching logic. However, when the number of options exceeds about 5, then ‘Switch’ is easier to code and easier to add more options. By trying a few simple examples you will soon appreciate the types of bracket, and the structure of the pattern with its matching statement block. I say again, ‘Switch’ is one of the most satisfying constructions to create, therefore never miss a chance to replace multiple ‘If’s with one ‘Switch’.
Match and Like
The ‘match’ can be anywhere in the string. Moreover, the pattern does not have to be a complete match, neither does it have to be at the beginning of the string. -Match uses regular expressions for pattern matching. Incidentally -match and the other PowerShell conditional operators all have a negative form, for example -notmatch.
Example 1a – Does not have to be at the beginning
$Guy =”Guy Thomas 1949″
$Guy -match “Th”
Result PS> True
Example 1b – Completely wrong name
$Guy =”Guy Thomas 1949″
$Guy -match “Guido”
Result PS> False
Example 1c – Wrong date
$Guy =”Guy Thomas 1949″
$Guy -match “1948″
Result PS> False
Example 1d – Wildcard ? Rides to the rescue
$Guy =”Guy Thomas 1949″
$Guy -match “194?”
Result PS> True
Example 1e – Wmiobject and Where
get-wmiobject -list | where {$_.name -match “cim*”}
Negative -notmatch
For negative conditions, there is an alternative form called -notmatch.
With -like, both sides of the expression have to be the same, fortunately, you can employ the usual wildcards * and ?.
Example 2a – Having only part of the string is no good
$Guy =”Guy Thomas 1949″
$Guy -like “Th”
Result PS> False
Example 2b – Just the start of the string not enough
$Guy =”Guy Thomas 1949″
$Guy -like “Guy”
Result PS> False
Example 2c – Wildcard * is useful
$Guy =”Guy Thomas 1949″
$Guy -like “Guy*”
Result PS> True
Example 2d – Wildcard * but the rest has to be correct
$Guy =”Guy Thomas 1949″
$Guy -like “Gzkuy*”
Result PS> False
Example 2e – * Wildcard * Double wildcards are handy
$Guy =”Guy Thomas 1949″
$Guy -like “*Th*”
Result PS> True
If your logic needs the negative, then try -notlike. In addition, -notlike and -like have variants that force case sensitivity. -clike and -cnotlike.
Difference Between -like and -match
$Guy =”Guy Thomas 1949″
$Guy -like “Th*”
Result PS> False
$Guy =”Guy Thomas 1949″
$Guy -match “Th*”
Result PS> True
The conditional operator -contains is similar to -eq, except it returns ‘True’ or ‘False’. -contains is designed for situations where you have a collection and wish to test one particular item.
Example 3a – Checks each item between the commas
$name = “Guy Thomas”, “Alicia Moss”, “Jennifer Jones”
$name -contains “Alicia Moss”
Result PS> True
Example 3b – Needs exact equality
$name = “Guy Thomas”, “Alicia Moss”, “Jennifer Jones”
$name -contains “Jones”
Result PS> False
Example 3c – Wildcards do no good
$name = “Guy Thomas”, “Alicia Moss”, “Jennifer Jones”
$name -contains “*Jones”
Result PS> False
While Loops
The ‘While’ loop is the easiest to master, and also the most flexible. Each type of PowerShell loop has specific syntax rules; in the case of the ‘While’ loop there are only two elements (condition) and {Block Statement}. As so often with PowerShell, the type of brackets is highly significant; (Parenthesis for the condition) and {curly braces for the command block}.
The way that the loop works is that PowerShell evaluates the condition at the start of each cycle, and if it’s true, then it executes the command block.
Here is a simple PowerShell ‘while’ loop to calculate, and then display, the 7 times table.
$i =7
while ($i -le 85) { $i; $i +=7}
Learning Points
Note 1: $i is a variable set to 7. Remember, the mission was to create the seven times table.
Note 2: Observe the two types of bracket (while) {Block Calculation}
Note 3: -le means less than or equals. (Other comparators are: -eq and -gt)
Note 4: +=7 increments the variable $i by seven on each loop.
Alternatively, we could use a semicolon to join the two statements to form one line.
$i =7; while ($i -le 85) { $i; $i +=7 }.
Do While Loop
In the ‘Do … While’ loop, PowerShell checks the (condition) at the end of each loop. One feature of the ‘Do While’ loop is that the {Command Block} is always executed at least once, this is because the ‘While’ comes after the ‘Do’.
$i = 7; do { $i; $i +=7 } while ($i -le 85)
Note 1: Without the semicolon it would need two lines thus:
do { $i; $i +=7 } while ($i -le 85)
Do Until
There is a variation of this style of loop, ‘Do .. Until’. The layout of the components is the same as ‘Do While’, the only difference is that the logic is changed from, do while condition is true, to, do until condition is true.
$i = 7; do { $i; $i +=7 } until ($i -gt 85)
Foreach Classic PowerShell Loop (3 Examples)
The PowerShell ‘ForEach’ loop is more complex, and has more arguments than the ‘for’ and ‘Do While’. The key feature is that loop interrogates an array, known as a collection. In addition to the position, and the type of bracket, observe the tiny, but crucial keyword, ‘in’.
Here is the syntax: ForEach ($item in $array_collection) {command_block}
PowerShell Example 1 – Math
foreach ($number in 1,2,3,4,5,6,7,8,9,10,11,12 ) { $number * 7}
foreach ($number in 1..12 ) { $number * 7}
$NumArray = (1,2,3,4,5,6,7,8,9,10,11,12)
foreach ($number in $numArray ) { $number * 7}
foreach ($number in 1,2,3,4,5,6,7,8,9,10,11,12 ) { $number * 7}
$NumArray = (1..12)
foreach ($number in $numArray ) { $number * 7}
Learning Points
Note 1: By creating five variations, my aim is to give you both perspective and experience of the PowerShell foreach loop.
Note 2: (1..12) is a convenient method of representing a sequence.
PowerShell Example 2 – To display files
Here is an example of a PowerShell ‘foreach’ loop which displays the filename and its size. In order to get this example to work, create a cmdlet by saving the following into a file, and give it a .ps1 extension. Call the cmdlet from the PS prompt. If the file is called ListDoc.ps1, and assuming that the file is in the current directory, then at the PS prompt type:
.\listdoc
Alternatively, from the PS prompt, type the full path D:\scripts\listdoc.
Cmdlet 1
foreach ($file in get-Childitem)
{
$file.name + ” ” +$file.length
}
In Cmdlet 2 (below), we can employ a simple ‘if’ statement to filter .txt files. Naturally, feel free to alter -eq “.txt” to a more suitable extension.
Cmdlet 2
# PowerShell foreach loop to display files LastAccessTime
“File Name ” + “`t Size” +”`t Last Accessed”
foreach ($file in get-Childitem)
{if ($file.extension -eq “.txt”)
{
$file.name + “`t ” +$file.length + “`t ” + $file.LastAccessTime
}
}
Learning Points
Note 0: If all else fails, copy the above code, and paste to PowerShell prompt, and then press ‘Enter’.
Note 1: `t means Tab.
Examples:
Replace contents in a text file with other text and write it to a new file:
Get-Content test.txt | ForEach-Object { $_ -replace “foo”, “bar” } | Set-Content test2.txt
Slow Motion with Sony Vegas
Jan 24th
If you ever wanted to apply a slow motion effect to your video, it’s much easier than you think with Sony Vegas. These instructions apply to Sony Vegas 8.0.
1. Right click on the imported audio track and select Properties. Now choose the classic method and make sure to check the “Lock to stretch” checkbox. 
2. Hold the CTRL key on the keyboard and drag the right side of the clip to the right to make it longer. This will distort and slow the video and sound.

That’s all there is to it! Enjoy.
How Turbo Chargers Work
Jan 22nd
When people talk about race cars or high-performance sports cars, the topic of turbochargers usually comes up. Turbochargers also appear on large diesel engines. A turbo can significantly boost an engine’s horsepower without significantly increasing its weight, which is the huge benefit that makes turbos so popular!
In this article, we’ll learn how a turbocharger increases the power output of an engine while surviving extreme operating conditions. We’ll also learn how wastegates, ceramic turbine blades and ball bearings help turbochargers do their job even better. Turbochargers are a type of forced induction system. They compress the air flowing into the engine (see How Car Engines Work for a description of airflow in a normal engine). The advantage of compressing the air is that it lets the engine squeeze more air into a cylinder, and more air means that more fuel can be added. Therefore, you get more power from each explosion in each cylinder. A turbocharged engine produces more power overall than the same engine without the charging. This can significantly improve the power-to-weight ratio for the engine
In order to achieve this boost, the turbocharger uses the exhaust flow from the engine to spin a turbine, which in turn spins an air pump. The turbine in the turbocharger spins at speeds of up to 150,000 rotations per minute (rpm) — that’s about 30 times faster than most car engines can go. And since it is hooked up to the exhaust, the temperatures in the turbine are also very high.
Keep reading to find out how much more power you can expect from your engine if you add a turbocharger.
Turbochargers allow an engine to burn more fuel and air by packing more into the existing cylinders. The typical boost provided by a turbocharger is 6 to 8 pounds per square inch (psi). Since normal atmospheric pressure is 14.7 psi at sea level, you can see that you are getting about 50 percent more air into the engine. Therefore, you would expect to get 50 percent more power. It’s not perfectly efficient, so you might get a 30- to 40-percent improvement instead.
Turbo Chargers
One cause of the inefficiency comes from the fact that the power to spin the turbine is not free. Having a turbine in the exhaust flow increases the restriction in the exhaust. This means that on the exhaust stroke, the engine has to push against a higher back-pressure. This subtracts a little bit of power from the cylinders that are firing at the same time.
The turbocharger is bolted to the exhaust manifold of the engine. The exhaust from the cylinders spins the turbine, which works like a gas turbine engine. The turbine is connected by a shaft to the compressor, which is located between the air filter and the intake manifold. The compressor pressurizes the air going into the pistons.
The exhaust from the cylinders passes through the turbine blades, causing the turbine to spin. The more exhaust that goes through the blades, the faster they spin.
On the other end of the shaft that the turbine is attached to, the compressor pumps air into the cylinders. The compressor is a type of centrifugal pump — it draws air in at the center of its blades and flings it outward as it spins.
In order to handle speeds of up to 150,000 rpm, the turbine shaft has to be supported very carefully. Most bearings would explode at speeds like this, so most turbochargers use a fluid bearing. This type of bearing supports the shaft on a thin layer of oil that is constantly pumped around the shaft. This serves two purposes: It cools the shaft and some of the other turbocharger parts, and it allows the shaft to spin without much friction.
There are many tradeoffs involved in designing a turbocharger for an engine. In the next section, we’ll look at some of these compromises and see how they affect performance.
Turbocharger Parts
One of the main problems with turbochargers is that they do not provide an immediate power boost when you step on the gas. It takes a second for the turbine to get up to speed before boost is produced. This results in a feeling of lag when you step on the gas, and then the car lunges ahead when the turbo gets moving.
One way to decrease turbo lag is to reduce the inertia of the rotating parts, mainly by reducing their weight. This allows the turbine and compressor to accelerate quickly, and start providing boost earlier. One sure way to reduce the inertia of the turbine and compressor is to make the turbocharger smaller. A small turbocharger will provide boost more quickly and at lower engine speeds, but may not be able to provide much boost at higher engine speeds when a really large volume of air is going into the engine. It is also in danger of spinning too quickly at higher engine speeds, when lots of exhaust is passing through the turbine.
A large turbocharger can provide lots of boost at high engine speeds, but may have bad turbo lag because of how long it takes to accelerate its heavier turbine and compressor. Luckily, there are some tricks used to overcome these challenges.
Most automotive turbochargers have a wastegate, which allows the use of a smaller turbocharger to reduce lag while preventing it from spinning too quickly at high engine speeds. The wastegate is a valve that allows the exhaust to bypass the turbine blades. The wastegate senses the boost pressure. If the pressure gets too high, it could be an indicator that the turbine is spinning too quickly, so the wastegate bypasses some of the exhaust around the turbine blades, allowing the blades to slow down.
Some turbochargers use ball bearings instead of fluid bearings to support the turbine shaft. But these are not your regular ball bearings — they are super-precise bearings made of advanced materials to handle the speeds and temperatures of the turbocharger. They allow the turbine shaft to spin with less friction than the fluid bearings used in most turbochargers. They also allow a slightly smaller, lighter shaft to be used. This helps the turbocharger accelerate more quickly, further reducing turbo lag.
Ceramic turbine blades are lighter than the steel blades used in most turbochargers. Again, this allows the turbine to spin up to speed faster, which reduces turbo lag.
Using Two Turbochargers & More Turbo Parts
Some engines use two turbochargers of different sizes. The smaller one spins up to speed very quickly, reducing lag, while the bigger one takes over at higher engine speeds to provide more boost.
When air is compressed, it heats up; and when air heats up, it expands. So some of the pressure increase from a turbocharger is the result of heating the air before it goes into the engine. In order to increase the power of the engine, the goal is to get more air molecules into the cylinder, not necessarily more air pressure.
An intercooler or charge air cooler is an additional component that looks something like a radiator, except air passes through the inside as well as the outside of the intercooler. The intake air passes through sealed passageways inside the cooler, while cooler air from outside is blown across fins by the engine cooling fan.
The intercooler further increases the power of the engine by cooling the pressurized air coming out of the compressor before it goes into the engine. This means that if the turbocharger is operating at a boost of 7 psi, the intercooled system will put in 7 psi of cooler air, which is denser and contains more air molecules than warmer air.
A turbocharger also helps at high altitudes, where the air is less dense. Normal engines will experience reduced power at high altitudes because for each stroke of the piston, the engine will get a smaller mass of air. A turbocharged engine may also have reduced power, but the reduction will be less dramatic because the thinner air is easier for the turbocharger to pump.
Older cars with carburetors automatically increase the fuel rate to match the increased airflow going into the cylinders. Modern cars with fuel injection will also do this to a point. The fuel-injection system relies on oxygen sensors in the exhaust to determine if the air-to-fuel ratio is correct, so these systems will automatically increase the fuel flow if a turbo is added.
If a turbocharger with too much boost is added to a fuel-injected car, the system may not provide enough fuel — either the software programmed into the controller will not allow it, or the pump and injectors are not capable of supplying it. In this case, other modifications will have to be made to get the maximum benefit from the turbocharger.
Nice, Karim. “How Turbochargers Work.” 04 December 2000. HowStuffWorks.com.
My Favorite iPhone Apps
Jan 22nd
Audacity – Sound and Music Recording Software (FREEWARE)
Jan 21st
Audacity® is free, open source software for recording and editing sounds. It is available for Mac OS X, Microsoft Windows, GNU/Linux, and other operating systems. Get if free from http://audacity.sourceforge.net/download/.
Recording

Audacity can record live audio through a microphone or mixer, or digitize recordings from cassette tapes, vinyl records, or minidiscs. With some sound cards, it can also capture streaming audio.
- Record from microphone, line input, or other sources.
- Dub over existing tracks to create multi-track recordings.
- Record up to 16 channels at once (requires multi-channel hardware).
- Level meters can monitor volume levels before, during, and after recording.
Import and Export
Import sound files, edit them, and combine them with other files or new recordings. Export your recordings in several common file formats.
- Import and export WAV, AIFF, AU, and Ogg Vorbis files.
- Import MPEG audio (including MP2 and MP3 files) with libmad.
- Export MP3s with the optional LAME encoder library.
- Create WAV or AIFF files suitable for burning to CD.
- Import and export all file formats supported by libsndfile.
- Open raw (headerless) audio files using the “Import Raw” command.
- Note: Audacity does not currently support WMA, AAC, or most other proprietary or restricted file formats.
Editing
- Easy editing with Cut, Copy, Paste, and Delete.
- Use unlimited Undo (and Redo) to go back any number of steps.
- Very fast editing of large files.
- Edit and mix an unlimited number of tracks.
- Use the Drawing tool to alter individual sample points.
- Fade the volume up or down smoothly with the Envelope tool.
Effects
- Change the pitch without altering the tempo, or vice-versa.
- Remove static, hiss, hum, or other constant background noises.
- Alter frequencies with Equalization, FFT Filter, and Bass Boost effects.
- Adjust volumes with Compressor, Amplify, and Normalize effects.
- Other built-in effects include:
- Echo
- Phaser
- Wahwah
- Reverse
Sound Quality
- Record and edit 16-bit, 24-bit, and 32-bit (floating point) samples.
- Record at up to 96 kHz.
- Sample rates and formats are converted using high-quality resampling and dithering.
- Mix tracks with different sample rates or formats, and Audacity will convert them automatically in realtime.
Plug-Ins
- Add new effects with LADSPA plug-ins.
- Audacity includes some sample plug-ins by Steve Harris.
- Load VST plug-ins for Windows and Mac, with the optional VST Enabler.
- Write new effects with the built-in Nyquist programming language.
Analysis
- Spectrogram mode for visualizing frequencies.
- “Plot Spectrum” command for detailed frequency analysis.
Free and Cross-Platform
- Licensed under the GNU General Public License (GPL).
- Runs on Mac OS X, Windows, and GNU/Linux.
Windows 7 – Copy command output from command prompt to clipboard
Jan 20th
Ever wanted to get the output from an entered command in the windows command prompt? Well now you can. Try this out:
1. Go to CMD by clicking on the start menu and then in the search bar type “cmd” and press enter.
2. Enter “ipconfig |clip” and press enter.

3. Now type “notepad” and hit enter.
4. Press Crtl + V to paste the output into notepad.

Try this one too. This one will copy the contents of a directory to the clip board: dir |clip. Just make sure that your “working directory” (C:\Users\…) is the directory you want to list. Enjoy!
Windows 7 File Search Tip
Jan 20th
Pressing Windows + F will bring up the Search Results window, allowing you to search for a file. The same can be accomplished by just hitting Windows (or Start) and typing in the little search box, but the Search Results (Windows + F) instantly gives you more sorting options and a better ability to view documents.






