microsoft windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/i/a1lsmeuvtgs.pdf ·...

49

Upload: trinhdat

Post on 15-Apr-2018

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line
Page 2: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Microsoft ®

Windows 7UNLEASHED

800 East 96th Street, Indianapolis, Indiana 46240 USA

Paul McFedries

Page 3: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Microsoft Windows 7 UnleashedCopyright © 2010 by Pearson Education, Inc.

All rights reserved. No part of this book shall be reproduced, stored in a retrievalsystem, or transmitted by any means, electronic, mechanical, photocopying, recording,or otherwise, without written permission from the publisher. No patent liability isassumed with respect to the use of the information contained herein. Although everyprecaution has been taken in the preparation of this book, the publisher and authorassume no responsibility for errors or omissions. Nor is any liability assumed fordamages resulting from the use of the information contained herein.

ISBN-13: 978-0-6723-3069-8ISBN-10: 0-672-33069-5

Library of Congress Cataloging-in-Publication Data:

McFedries, Paul.

Microsoft Windows 7 unleashed / Paul McFedries.

p. cm.

ISBN 978-0-672-33069-8

1. Microsoft Windows (Computer file) 2. Operating systems (Computers) I. Title.

QA76.76.O63M398163 2010

005.4'46—dc22

2009024027

Printed in the United States of America

First Printing: July 2009

TrademarksAll terms mentioned in this book that are known to be trademarks or service markshave been appropriately capitalized. Pearson Education, Inc. cannot attest to the accu-racy of this information. Use of a term in this book should not be regarded as affectingthe validity of any trademark or service mark.

Warning and DisclaimerEvery effort has been made to make this book as complete and as accurate as possi-ble, but no warranty or fitness is implied. The information provided is on an “as is”basis. The author and the publisher shall have neither liability nor responsibility to anyperson or entity with respect to any loss or damages arising from the informationcontained in this book.

Bulk SalesPearson offers excellent discounts on this book when ordered in quantity for bulkpurchases or special sales. For more information, please contact:

U.S. Corporate and Government [email protected]

For sales outside of the U.S., please contact:

International [email protected]

Associate PublisherGreg Wiegand

Acquisitions EditorRick Kughen

Development EditorRick Kughen

Managing EditorPatrick Kanouse

Project EditorJennifer Gallant

Copy EditorKeith Cline

IndexerTim Wright

ProofreaderSheri Cain

Technical EditorMark Reddin

PublishingCoordinatorCindy Teeters

Interior DesignerGary Adair

Cover DesignerGary Adair

Compositor

Mark Shirar

Page 4: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Contents at a GlanceIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Part I Unleashing Windows 7 Customization

1 Customizing Windows Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Customizing Internet Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3 Customizing the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4 Customizing Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5 Customizing the Start Menu and Taskbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

Part II Unleashing Windows 7 Performance and Maintenance

6 Tuning Windows 7’s Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

7 Maintaining Your Windows 7 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

Part III Unleashing Windows 7 Power User Tools

8 Controlling Windows 7 with Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

9 Policing Windows 7 with Group Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

10 Configuring the Microsoft Management Console. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

11 Controlling Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

12 Tweaking the Windows 7 Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

13 Controlling Windows 7 from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

Part IV Unleashing Windows 7 Security

14 Securing Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297

15 Configuring Internet Explorer Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

16 Implementing Email Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

17 Securing the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359

18 Setting Up User Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

19 Implementing Network Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409

20 Tightening Wireless Network Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

Part V Unleashing Windows 7 Troubleshooting

21 Troubleshooting and Recovering from Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439

22 Troubleshooting Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461

23 Troubleshooting Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481

Page 5: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Part VI Unleashing Windows 7 Networking

24 Troubleshooting Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

25 Setting Up a Small Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511

26 Accessing and Using Your Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553

27 Making Remote Network Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585

28 Turning Windows 7 into a Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611

29 Adding Macs to Your Windows 7 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641

Part VII Unleashing Windows 7 Scripting

30 Scripting Windows 7 with WSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657

31 Scripting Windows with PowerShell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703

Part VIII Appendixes

A Windows 7 Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731

B Understanding TCP/IP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759

Microsoft Windows 7 Unleashediv

Page 6: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Table of Contents

Introduction 1

Who Should Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2How This Book Is Organized. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Part I: Unleashing Windows 7 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Part II: Unleashing Windows 7 Performance and Maintenance . . . . . . . . 3Part III: Unleashing Windows 7 Power User Tools . . . . . . . . . . . . . . . . . . . . . . . . . . 3Part IV: Unleashing Windows 7 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Part V: Unleashing Windows 7 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Part VI: Unleashing Windows 7 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Part VII: Unleashing Windows 7 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Part VIII: Appendixes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Conventions Used in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5How to Contact Me. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1 Customizing Windows Explorer 7

Returning the Menus to Their Rightful Place . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Changing the View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Viewing More Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Turning On File Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Stopping Delete Confirmations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Running Explorer in Full-Screen Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Exploring the View Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Moving User Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Taking Ownership of Your Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Running Custom Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Using Advanced Query Syntax to Search Properties . . . . . . . . . . . . . . . . . . . . . . 22Using Natural Language Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2 Customizing Internet Explorer 27

Displaying the Internet Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Controlling the Web Page Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Configuring the Page History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Adding More Search Engines to Internet Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Using Any Search Engine from the Address Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Make Tabs More Efficient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Loading Multiple Home Pages at Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Understanding Internet Explorer’s Advanced Options . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Contents v

Page 7: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

3 Customizing the File System 45

Understanding File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46File Types and File Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46File Types and the Registry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Working with Existing File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Setting the Default Action. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Creating a New File Type Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Example: Opening the Command Prompt in the Current Folder . . . . 51Hiding a File Type’s Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Associating an Extension with a Different Application. . . . . . . . . . . . . . . . . . 53Associating an Application with Multiple File Types . . . . . . . . . . . . . . . . . . . . . 55

Creating a New File Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56Associating Two or More Extensions with a Single File Type . . . . . . . . . . . . . . . . . . 57Customizing the New Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Adding File Types to the New Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Deleting File Types from the New Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Customizing Windows 7’s Open With List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Opening a Document with an Unassociated Application. . . . . . . . . . . . . . . 59How the Open With Feature Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Removing an Application from a File Type’s Open With Menu. . . . . . . 61Removing a Program from the Open With List . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Adding a Program to the Open With List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Disabling the Open With Check Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

4 Customizing Startup and Shutdown 63

Customizing Startups Using the Boot Configuration Data . . . . . . . . . . . . . . . . . . . . . 63Using Startup and Recovery to Modify the BCD . . . . . . . . . . . . . . . . . . . . . . . . . . 65Using the System Configuration Utility to Modify the BCD. . . . . . . . . . . 66Using BCDEDIT to Customize the Startup Options. . . . . . . . . . . . . . . . . . . . . . . 69

Customizing Startups with the Advanced Options Menu . . . . . . . . . . . . . . . . . . . . . . 73Useful Windows 7 Logon Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

Logging On to a Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76Enabling the Administrator Account. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76Setting Up an Automatic Logon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79Disabling Automatic Logon Override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

Setting Up One-Click Restarts and Shutdowns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81Create a Restart Shortcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Create a Shutdown Shortcut. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

Turning Off Your Windows 7 Computer from Anywhere . . . . . . . . . . . . . . . . . . . . . . 84Customizing the Start Menu’s Power Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Customizing Your Notebook’s Power and Sleep Buttons. . . . . . . . . . . . . . . . . . . . . . . . 87

Microsoft Windows 7 Unleashedvi

Page 8: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

5 Customizing the Start Menu and Taskbar 89

Customizing the Start Menu for Easier Program and Document Launching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

Getting More Favorite Programs on the Start Menu. . . . . . . . . . . . . . . . . . . . . . 90Pinning a Favorite Program Permanently to the Start Menu. . . . . . . . . . . 92Clearing the Recent Programs List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94Setting Program Access and Defaults. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94Streamlining the Start Menu by Converting Links to Menus . . . . . . . . . . 96Adding, Moving, and Removing Other Start Menu Icons . . . . . . . . . . . . . . 97

Customizing the Taskbar for Easier Program and Document Launching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

Improving Productivity by Setting Taskbar Options. . . . . . . . . . . . . . . . . . . . . . 98Pinning a Favorite Program to the Taskbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Pinning a Destination to a Program’s Jump List . . . . . . . . . . . . . . . . . . . . . . . . . 101Using the Windows Key to Start Taskbar Programs . . . . . . . . . . . . . . . . . . . . . 102Taking Control of the Notification Area. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103Displaying Multiple Clocks for Different Time Zones . . . . . . . . . . . . . . . . . . 106Displaying the Built-In Taskbar Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108Setting Some Taskbar Toolbar Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108Creating New Taskbar Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

Modifying the Start Menu and Taskbar with Group Policies . . . . . . . . . . . . . . . . . 109

6 Tuning Windows 7’s Performance 111

Monitoring Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Viewing Your Computer’s Performance Rating . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Monitoring Performance with Task Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114Using the Resource Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Using the Performance Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Optimizing Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Reducing or Eliminating BIOS Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Reducing the OS Choices Menu Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Turning Off the Startup Splash Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Upgrading Your Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123Using an Automatic Logon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123Configuring the Prefetcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

Optimizing Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123Adding More Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Installing to the Fastest Hard Drive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Optimizing Application Launching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Getting the Latest Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Optimizing Windows 7 for Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Setting the Program Priority in Task Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

Contents vii

Page 9: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Optimizing the Hard Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126Examining Hard Drive Performance Specifications . . . . . . . . . . . . . . . . . . . . . 126Performing Hard Drive Maintenance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127Disabling Compression and Encryption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128Turning Off the Content Indexing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128Enabling Write Caching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128Converting FAT16 and FAT32 Partitions to NTFS. . . . . . . . . . . . . . . . . . . . . . . . 129Turning Off 8.3 Filename Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Disabling Last Access Timestamp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

Optimizing Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Storing the Page File Optimally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Splitting the Page File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Customizing the Page File Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Watching the Page File Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132Changing the Paging File’s Location and Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

7 Maintaining Your Windows 7 System 135

Checking Your Hard Disk for Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135Understanding Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137Understanding Cycles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138Running the Check Disk GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Checking Free Disk Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140Deleting Unnecessary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143Defragmenting Your Hard Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

Running the Disk Defragmenter Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Changing the Disk Defragmenter Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147Changing Which Disks Get Defragmented . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Preparing for Trouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Setting System Restore Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Creating a System Repair Disc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

Backing Up Your Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153Configuring Automatic File Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155Creating a System Image Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

Checking for Updates and Security Patches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158Reviewing Event Viewer Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160Setting Up a 9-Step Maintenance Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

8 Controlling Windows 7 with Control Panel 165

Touring the Control Panel Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166Reviewing the Control Panel Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167Understanding Control Panel Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172Easier Access to Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Microsoft Windows 7 Unleashedviii

Page 10: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Alternative Methods for Opening Control Panel Icons . . . . . . . . . . . . . . . . 175Putting Control Panel on the Start Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

Removing an Icon from Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Showing Only Specified Control Panel Icons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

9 Policing Windows 7 with Group Policies 181

Understanding Group Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181Local Group Policy Editor and Windows Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182Launching the Local Group Policy Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Working with Group Policies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

Configuring a Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185Filtering Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

Group Policy Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Customizing the Windows Security Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Customizing the Places Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191Increasing the Size of the Recent Documents List . . . . . . . . . . . . . . . . . . . . . . . 193Enabling the Shutdown Event Tracker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

10 Configuring the Microsoft Management Console 197

Reviewing the Windows 7 Snap-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197Launching the MMC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Adding a Snap-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Saving a Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202Creating a Custom Taskpad View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203Controlling Snap-Ins with Group Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

11 Controlling Services 209

Controlling Services with the Services Snap-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209Controlling Services at the Command Prompt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212Controlling Services with a Script. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213Disable Services for Faster Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217Make Windows Shut Down Services Faster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222Reset a Broken Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

12 Tweaking the Windows 7 Registry 225

Firing Up the Registry Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Getting to Know the Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

Navigating the Keys Pane. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227Understanding Registry Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228Getting to Know the Registry’s Root Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229Understanding Hives and Registry Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

Contents ix

Page 11: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Keeping the Registry Safe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233Preventing Other Folks from Messing with the Registry. . . . . . . . . . . . . . . 233Backing Up the Registry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234Saving the Current Registry State with System Restore . . . . . . . . . . . . . . . . 234Protecting Keys by Exporting Them to Disk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

Working with Registry Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236Changing the Value of a Registry Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237Renaming a Key or Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243Creating a New Key or Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243Deleting a Key or Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

Finding Registry Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

13 Controlling Windows 7 from the Command Line 245

Getting to the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246Running Command Prompt as the Administrator . . . . . . . . . . . . . . . . . . . . . . 246Running CMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

Working at the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251Running Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251Working with Long Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252Changing Folders Faster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253Taking Advantage of DOSKEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Redirecting Command Output and Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256Piping Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

Understanding Batch File Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260Creating Batch Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260REM: Adding Comments to a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261ECHO: Displaying Messages from a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . . 261PAUSE: Temporarily Halting Batch File Execution. . . . . . . . . . . . . . . . . . . . . . . 262Using Batch File Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263FOR: Looping in a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264GOTO: Jumping to a Line in a Batch File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265IF: Handling Batch File Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266

Working with the Command-Line Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Working with Disk Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Working with File and Folder Management Tools . . . . . . . . . . . . . . . . . . . . . . . 276Working with System Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

14 Securing Windows 7 297

Thwarting Snoops and Crackers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297First, Some Basic Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298Locking Your Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300Requiring Ctrl+Alt+Delete at Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

Microsoft Windows 7 Unleashedx

Page 12: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Checking Your Computer’s Security Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Making Sure Windows Firewall Is Turned On . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Making Sure Windows Defender Is Turned On. . . . . . . . . . . . . . . . . . . . . . . . . . . 303Making Sure User Account Control Is Turned On . . . . . . . . . . . . . . . . . . . . . . . 307Making Sure the Administrator Account Is Disabled . . . . . . . . . . . . . . . . . . . 307

Managing Windows Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Making Sure the Firewall Is Up to Snuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309Creating a Windows Firewall Exception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

15 Configuring Internet Explorer Security 315

Enhancing Your Browsing Privacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316Deleting Your Browsing History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316Clearing the Address Bar List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320Enhancing Online Privacy by Managing Cookies . . . . . . . . . . . . . . . . . . . . . . . 322Total Privacy: InPrivate Browsing and Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . 325

Enhancing Your Browsing Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327Blocking Pop-Up Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327Adding and Removing Zone Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328Changing a Zone’s Security Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330Protected Mode: Reducing Internet Explorer’s Privileges . . . . . . . . . . . . . . 331Thwarting Phishers with the SmartScreen Filter . . . . . . . . . . . . . . . . . . . . . . . . . 332Encoding Addresses to Prevent IDN Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334Managing Add-Ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336Total Security: Internet Explorer Without Add-Ons. . . . . . . . . . . . . . . . . . . . . 336

Understand Internet Explorer’s Advanced Security Options . . . . . . . . . . . . . . . . . 337

16 Implementing Email Security 341

Protecting Yourself Against Email Viruses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Configuring Windows Defender to Scan Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345Thwarting Spam with Windows Live Mail’s Junk Filter. . . . . . . . . . . . . . . . . . . . . . . . 345

Setting the Junk Email Protection Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347Specifying Safe Senders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348Blocking Senders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349Blocking Countries and Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349

Email Phishing Protection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350Maintaining Your Privacy While Reading Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

Blocking Read Receipts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352Squashing Web Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352

Sending and Receiving Secure Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353Setting Up an Email Account with a Digital ID . . . . . . . . . . . . . . . . . . . . . . . . . . 354Obtaining Another Person’s Public Key. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

Contents xi

Page 13: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Sending a Secure Message. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356Receiving a Secure Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

17 Securing the File System 359

Setting Security Permissions on Files and Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Assigning a User to a Security Group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361Assigning a User to Multiple Security Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362Assigning Standard Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Assigning Special Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

Encrypting Files and Folders. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366Encrypting a Disk with BitLocker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

Enabling BitLocker on a System with a TPM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Enabling BitLocker on a System Without a TPM . . . . . . . . . . . . . . . . . . . . . . . . 369

18 Setting Up User Security 373

Understanding User Account Control (UAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374Elevating Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375Configuring User Account Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377User Account Control Policies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379

Creating and Enforcing Bulletproof Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380Creating a Strong Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381User Account Password Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381Taking Advantage of Windows 7’s Password Policies . . . . . . . . . . . . . . . . . . . 382Recovering from a Forgotten Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

Creating and Managing User Accounts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384Working with the User Accounts Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Working with the Local Users and Groups Snap-In . . . . . . . . . . . . . . . . . . . . . 388

Setting Account Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389Setting Account Security Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389Setting User Rights Policies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391Setting Account Lockout Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391

Working with Users and Groups from the Command Line . . . . . . . . . . . . . . . . . . 393The NET USER Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393The NET LOCALGROUP Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394

Using Parental Controls to Restrict Computer Usage . . . . . . . . . . . . . . . . . . . . . . . . . . 395Activating Parental Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395Example: Setting Up Parental Controls for Games . . . . . . . . . . . . . . . . . . . . . . 397

More User Security Tricks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400Preventing Elevation for All Standard Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400Closing Off Your Computer by Disabling All Other Users . . . . . . . . . . . . 402Hiding Usernames in the Logon Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

Microsoft Windows 7 Unleashedxii

Page 14: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Renaming Built-In Accounts for Better Security. . . . . . . . . . . . . . . . . . . . . . . . . . 405Using the Guest Account to Give Folks Temporary Access. . . . . . . . . . . . 406Determining Who Is Logged On. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407

19 Implementing Network Security 409

Configuring Windows 7 for Secure Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410Making Sure Password-Protected Sharing Is Enabled . . . . . . . . . . . . . . . . . . . 410Deactivating the Sharing Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410

Setting Sharing Permissions on Shared Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411Setting Security Permissions on Shared Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414Hiding Your Shared Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415Disabling the Hidden Administrative Shares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417Removing Stored Remote Desktop Credentials. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418Preventing Users from Logging On at Certain Times. . . . . . . . . . . . . . . . . . . . . . . . . . . 420

Setting a User’s Logon Hours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421Automatically Logging Off a User When the

Logon Hours Expire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422

20 Tightening Wireless Network Security 423

Displaying the Router’s Setup Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Entering the Router’s IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Using the Network Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

Specifying a New Administrative Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428Positioning the Access Point for Maximum Security . . . . . . . . . . . . . . . . . . . . . . . . . . . 428Encrypting Wireless Signals with WPA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430

Changing the Wireless Connection Security Properties. . . . . . . . . . . . . . . . 431Disabling Network SSID Broadcasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432

Connecting to a Hidden Wireless Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434Changing the Default SSID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435Enabling MAC Address Filtering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436

Getting the MAC Address of Your Wireless NIC . . . . . . . . . . . . . . . . . . . . . . . . . 437

21 Troubleshooting and Recovering from Problems 439

Troubleshooting Strategies: Determining the Source of a Problem . . . . . . . . . 440Did You Get an Error Message? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440Does an Error or Warning Appear in the Event Viewer Logs?. . . . . . . . 441Does an Error Appear in System Information? . . . . . . . . . . . . . . . . . . . . . . . . . . . 442Did You Recently Edit the Registry? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442Did You Recently Change Any Windows Settings?. . . . . . . . . . . . . . . . . . . . . . 442Did Windows 7 “Spontaneously” Reboot?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442

Contents xiii

Page 15: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Did You Recently Change Any Application Settings?. . . . . . . . . . . . . . . . . . . 445Did You Recently Install a New Program? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446Did You Recently Install a New Device? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446Did You Recently Install an Incompatible Device Driver?. . . . . . . . . . . . . 447Did You Recently Apply an Update from Windows Update?. . . . . . . . . 447

General Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447More Troubleshooting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448

Running the Windows 7 Troubleshooters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448Understanding Disk Diagnostics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449Understanding Resource Exhaustion Detection . . . . . . . . . . . . . . . . . . . . . . . . . . 450Running the Memory Diagnostics Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451Checking for Solutions to Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452

Troubleshooting Using Online Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455Recovering from a Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456

Booting Using the Last Known Good Configuration . . . . . . . . . . . . . . . . . . . 456Recovering Using System Restore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

22 Troubleshooting Devices 461

Managing Your Hardware with Device Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462Controlling the Device Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463Viewing Device Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463Showing Nonpresent Devices in Device Manager . . . . . . . . . . . . . . . . . . . . . . . 464Working with Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464Configuring Windows to Ignore Unsigned Device Drivers . . . . . . . . . . . 466Writing a Complete List of Device Drivers to a Text File . . . . . . . . . . . . . . 469Uninstalling a Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

Working with Device Security Policies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472Troubleshooting Device Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472

Troubleshooting with Device Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473Displaying a List of Nonworking Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474Troubleshooting Device Driver Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477Tips for Downloading Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478Troubleshooting Resource Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479

23 Troubleshooting Startup 481

First Things First: Some Things to Try Before Anything Else . . . . . . . . . . . . . . . . . 481When to Use the Various Advanced Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . 482

Safe Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Safe Mode with Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Safe Mode with Command Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Enable Boot Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483Enable Low-Resolution Video (640¥480) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484

Microsoft Windows 7 Unleashedxiv

Page 16: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Last Known Good Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484Directory Services Restore Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484Debugging Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484Disable Automatic Restart on System Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484Disable Driver Signature Enforcement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485

What to Do If Windows 7 Won’t Start in Safe Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . 485Recovering Using the System Recovery Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485Troubleshooting Startup Using the System Configuration Utility . . . . . . . . . . 487

24 Troubleshooting Networking 491

Repairing a Network Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491Checking the Connection Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493General Solutions to Network Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494

Turning On Network Discovery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495Updating the Router Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497

Troubleshooting from the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499A Basic Command-Line Troubleshooting Procedure . . . . . . . . . . . . . . . . . . . . 501Checking Connectivity with the PING Command. . . . . . . . . . . . . . . . . . . . . . 502Tracking Packets with the TRACERT Command . . . . . . . . . . . . . . . . . . . . . . . . . 504

Troubleshooting Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506Troubleshooting the NIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507Troubleshooting Wireless Network Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508

25 Setting Up a Small Network 511

Setting Up a Peer-to-Peer Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512Changing the Computer and Workgroup Name . . . . . . . . . . . . . . . . . . . . . . . . . 513Connecting to a Wireless Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

Working with Windows 7’s Basic Network Tools and Tasks . . . . . . . . . . . . . . . . . . 516Accessing the Network and Sharing Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516Setting Up a Homegroup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518Turning Off Homegroup Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522Viewing Network Computers and Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523Displaying a Network Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524Viewing Network Status Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525Customizing Your Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528

Managing Network Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529Opening the Network Connections Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530Renaming a Network Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530Enabling Automatic IP Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Setting Up a Static IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534Finding a Connection’s MAC Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537

Contents xv

Page 17: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Using a Network Connection to Wake Up a Sleeping Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539

Disabling a Network Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541Managing Wireless Network Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542

Opening the Manage Wireless Networks Window . . . . . . . . . . . . . . . . . . . . . . 542Creating an Ad Hoc Wireless Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543Working with Wireless Connection Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 545Renaming Wireless Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548Reordering Wireless Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548Creating User-Specific Wireless Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549Removing Wireless Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551

26 Accessing and Using Your Network 553

Accessing Shared Network Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554Viewing a Computer’s Shared Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554Working with Network Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556

Mapping a Network Folder to a Local Drive Letter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558Creating the Mapped Network Folder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559Mapping Folders at the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561Disconnecting a Mapped Network Folder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561

Creating a Network Location for a Remote Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562Accessing a Shared Printer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563Sharing Resources with the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565

Setting Sharing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566Creating User Accounts for Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567Monitoring Your Shared Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568

Working with Network Files Offline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571Activating the Offline Files Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572Making a File or Folder Available for Offline Use. . . . . . . . . . . . . . . . . . . . . . . . 572Changing the Amount of Disk Space Used by Offline Files . . . . . . . . . . 574Prohibiting a Network Folder from Being

Made Available Offline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575Encrypting Offline Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577Working with Network Files While You're Offline. . . . . . . . . . . . . . . . . . . . . . . 577Synchronizing Your Offline Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579Dealing with Synchronization Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582

27 Making Remote Network Connections 585

Setting Up the Remote Computer as a Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586Windows Versions That Can Act as Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586Setting Up User Accounts on the Host. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586

Microsoft Windows 7 Unleashedxvi

Page 18: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Configuring Windows 7 or Vista to Act as a Remote Desktop Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587

Configuring XP to Act as a Remote Desktop Host. . . . . . . . . . . . . . . . . . . . . . . 590Installing Remote Desktop on an XP Client Computer. . . . . . . . . . . . . . . . . . . . . . . . 591Connecting to the Remote Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592

Making a Basic Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592Making an Advanced Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593Working with the Connection Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598

Disconnecting from the Remote Desktop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599Connecting to a Remote Desktop via the Internet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599

Changing the Listening Port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600Configuring Windows Firewall. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601Determining the Host IP Address. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602Setting Up Port Forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602Connecting Using the IP Address and New Port . . . . . . . . . . . . . . . . . . . . . . . . . 603

Using Dynamic DNS to Access Your Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604Configuring a Network Computer for Remote Administration. . . . . . . . . . . . . . 605Using Virtual Private Network Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605

Configuring a Network Gateway for VPN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606Configuring the VPN Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608Making the VPN Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609

28 Turning Windows 7 into a Web Server 611

Understanding Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612Installing Internet Information Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613Accessing Your Website. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614

Creating a Windows Firewall Exception for the Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614

Accessing Your Website over the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615Accessing Your Website over the Internet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617

Understanding the Default Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617Viewing the Default Website Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618Viewing the Default Website with IIS Manager . . . . . . . . . . . . . . . . . . . . . . . . . . 619

Adding Folders and Files to the Default Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621Setting Permissions on the Default Website Folder . . . . . . . . . . . . . . . . . . . . . 621Adding a File to the Default Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622Changing the Default Website Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624Adding a Folder to the Default Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626

Controlling and Customizing Your Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628Stopping Your Website. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628Restarting Your Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629

Contents xvii

Page 19: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Renaming the Default Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629Changing the Website Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630Setting the Website’s Default Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631Working Without a Default Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632Disabling Anonymous Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635Viewing the Server Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637

29 Adding Macs to Your Windows 7 Network 641

Making Sure That SMB Support Is Activated in Mac OS X Tiger . . . . . . . . . . . . 641Connecting to the Windows Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643Connecting to a Windows Shared Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644

Connecting to a Seen Windows PC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644Connecting to an Unseen Windows PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645Working with the Windows PC’s Shared Folders . . . . . . . . . . . . . . . . . . . . . . . . 647Unmounting a Windows Shared Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648Backing Up Mac Data to a Windows Shared Folder. . . . . . . . . . . . . . . . . . . . . 648

Using a Mac to Make a Remote Desktop Connection to Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649

Letting Windows Computers See Your Mac Shares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652

30 Scripting Windows 7 with WSH 657

Understanding Windows Script Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657Scripts and Script Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659

Running Script Files Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660Using WScript for Windows-Based Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660Using CScript for Command-Line Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661Script Properties and .wsh Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662Running a Script as the Administrator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664

Programming Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665Working with Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666Working with Object Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667Assigning an Object to a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668Working with Object Collections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669

Programming the WScript Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670Displaying Text to the User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671Shutting Down a Script. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671Scripting and Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671

Programming the WshShell Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677Referencing the WshShell Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677Displaying Information to the User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677Running Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681

Microsoft Windows 7 Unleashedxviii

Page 20: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Working with Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682Working with Registry Entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685Working with Environment Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687

Programming the WshNetwork Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689Referencing the WshNetwork Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689WshNetwork Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689Mapping Network Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689Mapping Network Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690

Example: Scripting Internet Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691Displaying a Web Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691Navigating Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692Using the InternetExplorer Object’s Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 693Running Through a Sample Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693

Programming the Windows Management Instrumentation Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695

Referencing the WMI Service Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695Returning Class Instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696Scripting a Remote Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700

31 Scripting Windows with PowerShell 703

Getting Started with PowerShell. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704Starting a PowerShell Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704Understanding PowerShell Cmdlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705

Running PowerShell Cmdlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709Scripting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714

Returning Object Members. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714Selecting Object Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715A Brief Aside About Formatting Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717Filtering Object Instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719Sorting Object Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720Assigning an Object to a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722Working with Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723Returning the Value of a Property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723Setting the Value of a Property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723Working with Object Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724Working with Object Collections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724

Creating PowerShell Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726Setting the Script Execution Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726Working with the PowerShell Integrated

Scripting Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726Running PowerShell Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728

Contents xix

Page 21: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

A Windows 7 Keyboard Shortcuts 731

B Understanding TCP/IP 741

What Is TCP/IP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742Understanding IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743

The Structure of an IP Datagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743The Structure of an IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745IP Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748Dynamic IP Addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751Domain Name Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751

Understanding TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755TCP Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755The Structure of a TCP Segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756TCP Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758

Index 759

Microsoft Windows 7 Unleashedxx

Page 22: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

About the AuthorPaul McFedries is a full-time technical author who has worked with computers in oneform or another since 1975 and has used Windows since version 1. He is the author ofmore than 60 computer books that have sold over three million copies worldwide. Hisrecent titles include the Sams Publishing book Microsoft Windows Home Server Unleashedand the Que Publishing books Tweak It and Freak It: A Killer Guide to Making Windows RunYour Way, Networking with Microsoft Windows Vista, and Build It. Fix It. Own It: A Beginner’sGuide to Building and Upgrading a PC. Paul is also the proprietor of Word Spy(www.wordspy.com), a website devoted to tracking new words and phrases as they enterthe English language. Please visit Paul’s personal website at www.mcfedries.com or followhim on Twitter at twitter.com/paulmcf and twitter.com/wordspy.

DedicationFor Karen, of course, and for Gypsy, the Dog Unleashed!

AcknowledgmentsI’ve been writing computer books for more than 18 years now (ouch!), which is a longtime to do anything, much less something that exercises the old noodle the way research-ing and writing a computer book does. Despite that, however, I still leap out of bed mostmornings and can’t wait to get my hands on the keyboard once again and start tappingaway.

Maintaining enthusiasm for your job is never easy, but it sure helps when you get to workwith some amazingly smart, talented, and nice people. I speak, of course, of the brightlights who populate the Que editorial department, who are as awesome a collection ofHoosiers as you’re ever likely to meet (assuming you come across Hoosier collections regu-larly). In particular, I’d like to extend my heartfelt and profuse thanks to the editors Iworked with directly on this book, including Acquisitions Editor and Development EditorRick Kughen; Project Editor Jennifer Gallant; Copy Editor Keith Cline; and TechnicalEditor Mark Reddin. Thanks to all of you for the excellent work.

Page 23: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

We Want to Hear from You!As the reader of this book, you are our most important critic and commentator. We valueyour opinion and want to know what we’re doing right, what we could do better, whatareas you’d like to see us publish in, and any other words of wisdom you’re willing topass our way.

As an associate publisher for Sams Publishing, I welcome your comments. You can emailor write me directly to let me know what you did or didn’t like about this book—as wellas what we can do to make our books better.

Please note that I cannot help you with technical problems related to the topic of this book. Wedo have a User Services group, however, where I will forward specific technical questions related tothe book.

When you write, please be sure to include this book’s title and author as well as yourname, email address, and phone number. I will carefully review your comments and sharethem with the author and editors who worked on the book.

Email: [email protected]

Mail: Greg WiegandAssociate Publisher Sams Publishing800 East 96th StreetIndianapolis, IN 46240 USA

Reader ServicesVisit our website and register this book at informit.com/register for convenient access toany updates, downloads, or errata that might be available for this book.

Page 24: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

Introduction

We shall not cease from explorationAnd the end of all our exploringWill be to arrive where we startedAnd know the place for the first time.—T. S. Eliot

Well, that was easy. After the “two steps forward, onestep back” development process of Windows Vista, after theinterminable Vista beta releases, and after the hype andhoopla that accompanied the Vista release, Windows 7seemed to arrive on our digital doorsteps fully formed, likea kind of electronic Athena from the skull of some program-ming Zeus (or something like that).

The development and release of Microsoft’s latest bouncing-baby operating system was nothing like its older sibling,but does that mean that Windows 7 itself is nothing likeWindows Vista? Actually, in many ways, that’s true. Sure, ifyou’re familiar with Windows Vista, you’ll have a relativelybenign learning curve with Windows 7. But Microsoftdidn’t spend the past 3 years working on new desktop back-grounds! Windows 7 is loaded with new and changedfeatures; some of them are almost too subtle to notice,whereas others represent veritable system sea changes.

Coincidentally (or not, depending on where you fall in theconspiracy theory spectrum), my approach to Windows hasalso changed in this edition of the book. Unlike in previouseditions, Windows 7 Unleashed is not my attempt to cover allthe features of Windows from Aero Glass to AutoPlay.Windows has simply become too big for that kind of book,and most Windows users know (or can figure out) the basicsof most features. So in this edition of the book, I’ve changed

Page 25: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

2 Introduction

the focus from components (Internet Explorer, Mail, and so on) to subjects: customization,performance, power tools, security, troubleshooting, and networking, and scripting. Youget in-depth and useful coverage of these seven areas that will help you unleash the fullpotential of Windows 7.

Who Should Read This BookAll writers write with an audience in mind. Actually, I’m not sure whether that’s true fornovelists and poets and the like, but it should be true for any technical writer who wantsto create a useful and comprehensible book. Here are the members of my own imaginedaudience:

. IT professionals—These brave souls must decide whether to move to Windows 7,work out deployment issues, and support the new Windows 7 desktops. The wholebook has information related to your job and Windows 7.

. Power users—These elite users get their power via knowledge. With that in mind,this book extends the Windows power user’s know-how by offering scripts, Registrytweaks, group policy configurations, and other power tools.

. Business users—If your company is thinking of or has already committed tomoving to Windows 7, you need to know what you, your colleagues, and your staffare getting into. You also want to know what Windows 7 will do to improve yourproductivity and make your life at the office easier. You learn all of this and morein this book.

. Small business owners—If you run a small or home business, you probably wantto know whether Windows 7 will give you a good return on investment. Will itmake it easier to set up and maintain a network? Will Windows 7 computers bemore stable? Will your employees be able to collaborate easier? The answer turns outto be “yes” for all of these questions, and I’ll show you why.

. Home users—If you use Windows 7 at home, you probably want to maximize per-formance, keep your system running smoothly, max out security, and perform cus-tomizations that make Windows 7 conform to your style. Check, check, check,check. This book’s got your covered in all these areas.

Also, to keep the chapters uncluttered, I’ve made a few assumptions about what you knowand what you don’t know:

. I assume that you have knowledge of rudimentary computer concepts, such as filesand folders.

. I assume that you’re familiar with the basic Windows skills: mouse maneuvering,dialog box negotiation, pull-down menu jockeying, and so on.

. I assume that you can operate peripherals attached to your computer, such as thekeyboard and printer.

Page 26: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

3How This Book Is Organized

. I assume that you’ve used Windows for a while and are comfortable with conceptssuch as toolbars, scrollbars, and, of course, windows.

. I assume that you have a brain that you’re willing to use and a good supply ofinnate curiosity.

How This Book Is OrganizedAs I mentioned earlier, I’ve completely revamped the structure and coverage in thisedition, so the next few sections offer a summary of what you’ll find in each part.

Part I: Unleashing Windows 7 Customization

Your purchase of this book (a sound and savvy investment on your part, if I do say somyself) indicates that you’re not interested in using Windows 7 in its out-of-the-boxconfiguration. If you’re looking to make Windows 7 your own, begin at the beginningwith the five chapters in Part I. You learn how to customize Windows Explorer (Chapter1), Internet Explorer (Chapter 2), the file system (Chapter 3), startup and shutdown(Chapter 4), and the Start menu and taskbar (Chapter 5).

Part II: Unleashing Windows 7 Performance and Maintenance

Everybody wants Windows to run faster, so you’ll no doubt be pleased that I devote anentire chapter to this important topic (Chapter 6). Everybody wants Windows to runsmoother, so you’ll also no doubt be pleased that I devote yet another chapter to thatimportant topic (Chapter 7).

Part III: Unleashing Windows 7 Power User Tools

The chapters in Part III kick your advanced Windows 7 education into high gear by cover-ing the ins and outs of a half dozen important Windows 7 power tools: Control Panel(Chapter 8), Local Group Policy Editor (Chapter 9), Microsoft Management Console(Chapter 10), the Services snap-in (Chapter 11), the Registry Editor (Chapter 12), andCommand Prompt (Chapter 13).

Part IV: Unleashing Windows 7 Security

With threats to our digital lives coming at us from all sides these days, security may justbe the most vital topic in technology. So perhaps that’s why Part IV is the biggest sectionin the book, with no less than seven chapters devoted to various aspects of Windows 7security. Your first learn some general techniques for locking down Windows 7 (Chapter14), and you then learn how to configure web security (Chapter 15), email security(Chapter 16), file system security (Chapter 17), user security (Chapter 18), wired networksecurity (Chapter 19), and wireless network security (Chapter 20).

Page 27: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

4 Introduction

Part V: Unleashing Windows 7 Troubleshooting

Windows 7 may represent the state of Microsoft’s operating system art, but it is stillWindows, which means problems, bugs, and glitches are pretty much inevitable. The fourchapters in Part V can help when the Windows demons strike. You learn general trou-bleshooting techniques (Chapter 21), and how to troubleshoot device (Chapter 22),startup (Chapter 23), and networking (Chapter 24).

Part VI: Unleashing Windows 7 Networking

It’s a rare home or small office that doesn’t have (or doesn’t want to have) a network, andPart VI is a reflection of this fact (that I just made up). You learn how to set up a smallnetwork (Chapter 25), how to access and use that network (Chapter 26), how to accessyour network from remote locations (Chapter 27), how to use Windows 7 as a web server(Chapter 28), and how to incorporate Macs into your network (Chapter 29).

Part VII: Unleashing Windows 7 Scripting

To close out the main part of this book, Part VII takes an in-depth look at two methods forautomating Windows tasks with scripts: Windows Scripting Host (Chapter 30) andWindows PowerShell (Chapter 31).

Part VIII: Appendixes

To further your Windows 7 education, Part VIII presents two appendixes that containextra goodies. You’ll find a complete list of Windows 7 shortcut keys (Appendix A), and adetailed look at the TCP/IP protocols that underlie Windows 7 networking (Appendix B).

Page 28: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

5Conventions Used in This Book

Conventions Used in This BookTo make your life easier, this book includes various features and conventions that helpyou get the most out of this book and Windows 7 itself:

Steps Throughout the book, I’ve broken many Windows 7 tasks into easy-to-follow step-by-step procedures.

Things you type Whenever I suggest that you type something, what you type appearsin a bold monospace font.

Filenames, foldernames, and code

These things appear in a monospace font.

Commands Commands and their syntax use the monospace font, too. Commandplaceholders (which stand for what you actually type) appear in anitalic monospace font.

Pull-down menucommands

I use the following style for all application menu commands: Menu,

Command, where Menu is the name of the menu that you pull downand Command is the name of the command you select. Here’s anexample: File, Open. This means that you pull down the File menuand select the Open command.

Code continuationcharacter

When a line of code is too long to fit on only one line of this book, itis broken at a convenient place and continued to the next line. Thecontinuation of the line is preceded by a code continuation character([➥]). You should type a line of code that has this character as onelong line without breaking it.

This book also uses the following boxes to draw your attention to important (or merelyinteresting) information:

NOTE

The Note box presents asides that give you more information about the current topic.These tidbits provide extra insights that give you a better understanding of the task. Inmany cases, they refer you to other sections of the book for more information.

TIP

The Tip box tells you about Windows 7 methods that are easier, faster, or more effi-cient than the standard methods.

Page 29: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

6

CAUTION

The all-important Caution box tells you about potential accidents waiting to happen.There are always ways to mess things up when you’re working with computers. Theseboxes help you avoid at least some of the pitfalls.

How to Contact MeIf you have any comments about this book, or if you want to register a complaint or acompliment (I prefer the latter), please don’t hesitate to send a missive my way. Theeasiest way to do that is to drop by my website, have a look around, and post a messageto the forum: www.mcfedries.com/.

If you do the Twitter thing, you can follow my tweets here: http://twitter.com/paulmcf.

Introduction

Page 30: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

CHAPTER 1

CustomizingWindows Explorer

IN THIS CHAPTER

. Returning the Menus to TheirRightful Place

. Changing the View

. Viewing More Properties

. Turning On File Extensions

. Stopping Delete Confirmations

. Running Explorer in Full-Screen Mode

. Exploring the View Options

. Moving User Folders

. Taking Ownership of Your Files

. Running Custom Searches

Whoso would be a man, must be a nonconformist.—Ralph Waldo Emerson

Although I’m sure you’ve got countless more importantthings to do with your precious time, at least some of yourWindows 7 face time will be spent dealing with files,folders, and other Windows “f-words.” These file systemmaintenance chores are the unglamorous side of the digitallifestyle, but they are, regrettably, necessary for the smoothfunctioning of that lifestyle.

This means that you’ll likely be spending a lot of time withWindows Explorer over the years, so customizing it to yourliking will make you more efficient and more productive,and setting up Windows Explorer to suit your style shouldserve to remove just a bit of the drudgery of day-to-day filemaintenance. This chapter takes you through a few of myfavorite Windows Explorer customizations.

Returning the Menus to TheirRightful PlaceMicrosoft seems to hate pull-down menus, for some reason.Over the past few years, Microsoft has hidden the menusystem in many programs, and gotten rid of it altogether inOffice 2007 (although the old menu keystroke combina-tions still work). In those programs where the menus aremerely hidden, you can display them at any time by tappingthe Alt key. This works in Windows Explorer, too, and that’sa good thing because Windows Explorer’s pull-down menus

Page 31: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

8 CHAPTER 1 Customizing Windows Explorer

have several useful commands that simply aren’t available through the taskbar, keyboardshortcuts, or even by right-clicking.

Still, it sticks in my craw that accessing the Windows Explorer menus requires the extrastep of Alt, particularly if I’m in mouse mode. If you feel the same way, follow these stepsto force Windows Explorer to display the menu bar full-time:

1. If you have a folder window open, select Organize, Folder and Search Options. (Nofolder windows open at the moment? Click Start, type folder, and then press Enterto select Folder Options in the search results.) The Folder Options dialog boxappears.

2. Click the View tab.

3. Click to activate the Always Show Menus check box.

4. Click OK. Windows Explorer (perhaps a tad grudgingly) restores the menu bar to itsrightful place.

Changing the ViewThe icons in Windows Explorer’s content area can be viewed in no less than eight differ-ent ways, which seems a tad excessive, but Windows has never been about restraint whenit comes to interface choices. To see a list of these views, either pull down the Viewsbutton in the task pane or click View in the menu bar. You get four choices for icon sizes:Extra Large Icons, Large Icons, Medium Icons, and Small Icons. You also get four otherchoices:

. List—This view divides the content area into as many rows as will fit vertically, andit displays the folders and files alphabetically down the rows and across thecolumns. For each object, Windows Explorer shows the object’s icon and name.

. Details—This view displays a vertical list of icons, where each icon shows the datain all the displayed property columns (such as Name, Date Modified, Type, andSize). See “Viewing More Properties,” later in this chapter, to learn how to add tothese columns.

TIP

The default property columns you see depend on the template that the folder is using.To change the folder template, right-click the folder, click Properties, and then displaythe Customize tab. In the Optimize This Folder For list, choose the type you want:General Items, Documents, Pictures, Music, or Videos.

. Tiles—This view divides the content area into as many columns as will fit horizon-tally, and it displays the folders and files alphabetically across the columns anddown the rows. For each object, Windows Explorer shows the object’s icon, name,file type, and (for files only) size.

Page 32: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

9Viewing More Properties

. Content—This view, new to Windows 7, displays a vertical list of objects, and for each object it displays the object’s icon, name, last modified date,

size (files only), and any metadata associated with the object, such as author namesand tags; the album name, genre, and track length (for music; see Figure 1.1); andthe dimensions and date taken (for photos).

1

Viewing More PropertiesExplorer’s Details view is the preferred choice for power users because it displays a greatdeal of information in a relatively compact format. (The new Content view also provideslots of information, but each object takes up quite a bit of space, and the object propertiesthat you see aren’t customizable.) Details view also gives you a great deal of flexibility. Forexample, here are some techniques to you can use when working with the Details view:

. You can change the order of the property columns by dragging the column headingsto the left or right.

. You can sort on a column by clicking the column heading.

. You can adjust the width of a column by pointing the mouse at the right edge of thecolumn’s heading (the pointer changes to a two-headed arrow) and dragging thepointer left or right.

. You can adjust the width of a column so that it’s as wide as its widest data by dou-ble-clicking the right-edge of the column’s heading.

FIGURE 1.1 In Windows 7, Windows Explorer comes with a new Content view.

Page 33: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

10

TIP

To adjust all the columns so that they’re exactly as wide as their widest data, right-clickany column header and then click Size All Columns to Fit.

In addition, the Details view is informative because it shows you not only the name ofeach file, but also other properties, depending on the folder:

Documents—Name, Date Modified, Type, and Size

Pictures—Name, Date Taken, Tags, Size, and Rating

Videos—Name, Date Taken, Type, Size, and Length

Music—Track Name, Track Number, Track Title, Contributing Artists, and Album Title

Contacts—Name, E-mail Address, Business Phone, and Home Phone

These are all useful, to be sure, but Explorer can display many more file properties. In fact,there are nearly 300 properties in all, and they include useful information such as thedimensions of a picture file, the bit rate of a music file, and the frame rate of a video file.To see these and other properties, you have two choices:

. To see the most common properties for the current folder type, right-click anycolumn header and then click the property you want to add.

. To see the complete property list, right-click any column header and then clickMore. The Choose Details dialog box that appears (see Figure 1.2) enables you toactivate the check boxes for the properties you want to see, as well as rearrange thecolumn order.

CHAPTER 1 Customizing Windows Explorer

FIGURE 1.2 Use the Choose Details dialog box to add or remove property columns inWindows Explorer.

Page 34: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

11Turning On File Extensions1

FIGURE 1.3 With file extensions turned off, it’s tough to tell one file from another.

Turning On File ExtensionsMicrosoft figures that, crucial or not, the file extension concept is just too hard for newusers to grasp. Therefore, right out of the box, Windows Explorer doesn’t display fileextensions. This may not sound like a big whoop, but not being able to see the extensionfor each file can be downright confusing. To see why, suppose you have a folder withmultiple documents that use the same primary name. This is a not uncommon scenario,but it’s also a fiendish one because it’s often difficult to tell which file is which.

For example, Figure 1.3 shows a folder with 18 different files, all apparently namedProject. Windows unrealistically expects users to tell files apart just by examining theiricons. To make matters worse, if the file is an image, Windows 7 shows a thumbnail of theimage instead of an icon. (This happens in thumbnail views such as Tiles, Medium Icons,and Large Icons.) The result is that in Figure 1.3 it’s impossible to tell at a glance whichimage is a GIF, which is a JPEG, and so on.

Page 35: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

12 CHAPTER 1 Customizing Windows Explorer

The need to become an expert in Windows iconography is bad enough, but it gets worse.Not being able to see file extensions also leads to two other problems:

. You can’t rename extensions—For example, suppose you have a text file namedindex.txt and you want to rename it to index.html to make it a web page file.Nope, sorry, you can’t do it with file extensions hidden. If you try—that is, if youclick the file, press F2 to choose the Rename command, and then type index.html—you just end up with a text file named index.html.txt.

. You can’t save a document under an extension of your choice—Similarly, withfile extensions turned off, Windows 7 forces you to save a file using the defaultextension associated with an application. For example, if you’re working in Notepad,every file you save must have a .txt extension. If you create your own web pages,for example, you can’t rename these text files with typical web page extensions suchas .htm, .html, .asp, and so on.

TIP

There is a way to get around the inability to save a document under an extension ofyour choice. In the Save As dialog box, use the Save as Type list to select the All Filesoption, if it exists. You can then use the File Name text box to type the filename withthe extension you prefer to use.

You can overcome all these problems by turning on file extensions, as described in thefollowing steps:

1. If you have a folder window open, select Organize, Folder and Search Options (orTools, Folder Options if you have the menu displayed; otherwise, click Start, typefolder, and then press Enter to select Folder Options in the search results). TheFolder Options dialog box appears.

2. Click the View tab.

3. Deactivate the Hide Extensions for Known File Types check box.

4. Click OK.

Figure 1.4 shows the Project files with extensions in full display.

Page 36: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

13Stopping Delete Confirmations

FIGURE 1.4 With file extensions turned on, it’s much easier to tell the files apart.

Stopping Delete ConfirmationsMy biggest Windows pet peeves center around tasks that require you to jump throughextra hoops that are totally unnecessary. In Windows XP, for example, clicking the ShutDown command on the Start menu doesn’t shut down your computer, at least not rightaway. Instead, a dialog box shows up and you need to click Shut Down yet again. Dumb!

Another unnecessary dialog box that shows up in all versions of Windows is the “Are yousure you want to move this file to the Recycle Bin?” prompt that pops up when you pressDelete. Now you either need to move your hand to the mouse to click Yes, or you cankeep your hands on the keyboard by pressing Alt+Y. Either way, it’s an extra step that justslows you down.

One way to avoid this confirmation dialog box is to click and drag the file you want todelete and then drop it on the desktop’s Recycle Bin icon. That’s nice to know, but most ofus rarely see our desktops these days, so this method is not very practical.

A much better solution is to configure Recycle Bin to not display the confirmation dialogbox at all. Here’s how it’s done:

1. Right-click the desktop’s Recycle Bin icon and then click Properties. Windows 7displays the Recycle Bin’s property sheet.

2. Click to deactivate the Display Delete Confirmation Dialog check box.

3. Click OK to put the new setting into effect.

1

Page 37: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

14 CHAPTER 1 Customizing Windows Explorer

Now let’s consider this tweak from the opposite point of view. The reason Windowsdisplays the delete confirmation dialog box by default is to prevent you from accidentallydeleting a file. You and I are savvy, knowledgeable users, so we know when we want todelete something, but not everyone falls into this boat. If you have young kids or elderlyfolks who use Windows, you know that the delete confirmation dialog box is an excellentsafeguard for these and other inexperienced users.

In that case, you might be wondering if there’s a way to ensure that a novice user can’tturn off the delete confirmation dialog box. Yes, in fact, there is, although it’s a bit harderto implement because it involves changing a policy setting on the user’s computer. Apolicy setting is a kind of rule that an administrator applies to a Windows system, and thatrule can’t be overridden except by another administrator. To apply a policy setting, youuse the Local Group Policy Editor, which I discuss in detail in Chapter 9, “PolicingWindows 7 with Group Policies.”

NOTE

The Local Group Policy Editor is available only with Professional, Enterprise, andUltimate versions of Windows 7. If you’re not running one of these versions, I’ll showyou how to perform the same tweak using the Registry (see Chapter 12, “Tweaking theWindows 7 Registry”).

You can use two ways to prevent a user from turning off delete confirmations:

. Disable the Display Delete Confirmation Dialog check box that appears in theRecycle Bin’s property sheet.

. Disable the Recycle Bin’s Properties command so that the user can’t display theRecycle Bin’s property sheet.

Follow these steps to implement one of these policies:

1. On the other user’s computer, click Start, type gpedit.msc, and then press Enter toselect the gpedit program that appears in the search results.

2. Open the User Configuration branch.

3. Open the Administrative Templates branch.

4. Display the property sheet of the policy you want to use, as follows:

. If you want to disable the Display Delete Confirmation Dialog check box, openthe Windows Components branch and then click Windows Explorer. Double-clickthe policy named Display Confirmation Dialog When Deleting Files. If you don’thave access to the Group Policy Editor, open the Registry Editor and create aDWORD setting named ConfirmFileDelete with the value 1 in the following key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

. If you want to disable the Recycle Bin’s Properties command, click Desktop andthen double-click the Remove Properties from the Recycle Bin Context Menu

Page 38: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

15Running Explorer in Full-Screen Mode

policy. If you don’t have access to the Group Policy Editor, open the RegistryEditor and create a DWORD setting named NoPropertiesRecycleBin with thevalue 1 in the following key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

NOTE

The Remove Properties from the Recycle Bin Context Menu policy has a misleadingname because, when enabled, the policy disables some but, strangely, not allinstances of the Recycle Bin’s Properties command. For example, if the user displaysthe desktop in a folder window and clicks Recycle Bin, the Properties command is dis-abled in both the Organize menu and the File menu. However, the Properties commandis still enabled when you right-click the Recycle Bin icon the desktop, but choosing thecommand only displays an error message.

5. Click the Enabled option.

6. Click OK to put the policy into effect.

Figure 1.5 shows the Recycle Bin property sheet with the Display Confirmation DialogWhen Deleting Files policy in effect. As you can see, the Display Delete ConfirmationDialog check box is activated and disabled, so the setting can’t be changed.

1

FIGURE 1.5 With the Display Confirmation Dialog When Deleting Files policy in effect, theDisplay Delete Confirmation Dialog check box is activated and disabled.

Running Explorer in Full-Screen ModeIf you want the largest possible screen area for the contents of each folder, you can placeWindows Explorer in full-screen mode by pressing F11. (You can also hold down Ctrl andclick the Maximize button; if Explorer is already maximized, you first have to click the

Page 39: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

16

Restore button.) This mode takes over the entire screen and hides the title bar, menu bar,status bar, address bar, and search bar. To work with the address bar or search bar, moveyour mouse pointer to the top of the screen. To restore the window, either press F11 againor display the address bar and search bar and then click the Full Screen button (which isto the right of the Search box).

Exploring the View OptionsWindows Explorer’s view boasts a large number of customization options that you need tobe familiar with. To see these options, you have two choices:

. In Windows Explorer, select Organize, Folder and Search Options (or Tools, FolderOptions if you have the menu bar displayed).

. Click Start, type folder, and then press Enter to select the Folder Options item inthe search results.

Either way, the view options can be found, appropriately enough, on the View tab of theFolder Options dialog box, as shown in Figure 1.6.

CHAPTER 1 Customizing Windows Explorer

Here’s a complete list of the various items in the Advanced Settings list:

. Always Show Icons, Never Thumbnails—Activate this check box to preventWindows Explorer from displaying file thumbnails. This can speed up the display ofsome folders that are heavy on pictures and other “thumbnail-able” file types.

FIGURE 1.6 The View tab has quite a few options for customizing Windows Explorer.

Page 40: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

17Exploring the View Options1

. Always Show Menus—As you saw earlier (see “Returning the Menus to TheirRightful Place”), you activate this check box to display the menu bar full time inWindows Explorer.

. Display File Icon on Thumbnails—When this check box is activated, WindowsExplorer superimposes the file type icon on the lower-right corner of each file’sthumbnail. This is usually a good idea because the extra icon allows you to figureout the file type at a glance. However, if you find the icon getting in the way of thethumbnail image, deactivate this setting.

. Display File Size Information in Folder Tips—When this setting is activated andyou hover your mouse pointer over a folder icon, Windows Explorer calculates thesize of the files and subfolders within the folder, and displays the size in a pop-upbanner. This is useful information, but if you find that your system takes too long tocalculate the file size, consider deactivating this setting.

NOTE

If you activate the Display File Size Information in Folder Tips setting, you must also acti-vate the Show Pop-Up Description for Folder and Desktop Items setting, described later.

. Display the Full Path in the Title Bar—Activate this setting to place the full path-name of the current folder in the Windows Explorer title bar. The full pathnameincludes the drive, the names of the parent folders, and the name of the currentfolder. Note that this only applies to Classic folders, which you activate by clickingthe Use Windows Classic Folders option in the General pane.

. Hidden Files and Folders—Windows 7 hides certain types of files by default. Thismakes sense for novice users because they could accidentally delete or rename animportant file. However, it’s a pain for more advanced users who might requireaccess to these files. You can use these options to tell Windows Explorer which filesto display:Do Not Show Hidden Files, Folders, or Drives—Activate this option to avoiddisplaying objects that have the hidden attribute set.

Show Hidden Files, Folders, and Drives—Activate this option to display thehidden files.

NOTE

Files are hidden from view by having their Hidden attribute activated. You can work withthis attribute directly by right-clicking a visible file, clicking Properties, and then togglingthe Hidden setting on and off.

Page 41: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

18 CHAPTER 1 Customizing Windows Explorer

. Hide Extensions for Known File Types—As you saw earlier (see “Turning On FileExtensions”), you deactivate this setting to display file extensions.

. Hide Protected Operating System Files—This setting is activated by default, and ittells Windows 7 to hide files that have the System attribute activated. This is notusually a problem because you rarely have to do anything with the Windows systemfiles. However, if you do need to see one of these files, deactivate this setting. WhenWindows 7 asks whether you’re sure, click Yes.

. Launch Folder Windows in a Separate Process—Activating this setting tellsWindows 7 to create a new thread in memory for each folder you open. This makesWindows Explorer more stable because a problem with one thread won’t crash theothers. However, this also means that Windows Explorer requires far greateramounts of system resources and memory. Activate this option only if your systemhas plenty of resources and memory.

. Show Drive Letters—If you deactivate this check box, Windows Explorer hides thedrive letters in the Computer folder and in the address bar when you open a drive.

NOTE

If you hide drive letters, Windows Explorer displays drive names such as Local Disk.This isn’t particularly useful, so consider renaming your drives. Right-click the driveand then click Rename. Note that you must enter administrator credentials to performthis operation.

. Show Encrypted or Compressed NTFS Files in Color—When this setting is acti-vated, Windows Explorer shows the names of encrypted files in a green font and thenames of compressed files in a blue font. This is a useful way to distinguish thesefrom regular files, but you can deactivate it if you prefer to view all your files in asingle color. Note that this only applies to files on NTFS partitions because onlyNTFS supports file encryption and compression.

. Show Pop-Up Description for Folder and Desktop Items—Some icons display apop-up banner when you point the mouse at them. For example, the default desktopicons display a pop-up banner that describes each icon. Use this setting to turn thesepop-ups on and off.

. Show Preview Handlers in Preview Pane—When this check box is activated,Windows Explorer includes controls for previewing certain types of files in the

Page 42: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

19Moving User Folders1

Reading pane. For example, when you display a video file in the Reading pane,Windows Explorer includes playback controls such as Play, Pause, and Stop.

. Use Check Boxes to Select Items—Activate this check box to add check boxes besideeach folder and file. You can then select objects by activating their check boxes.

. Use Sharing Wizard—When this check box is activated, Windows 7 uses a simpli-fied file and folder sharing method called the Sharing Wizard. Power users will wantto disable the Sharing Wizard (see Chapter 26, “Accessing and Using Your Network”).

. See “Deactivating the Sharing Wizard,” p. 410.

. When Typing into List View—These options determine Windows Explorer’s behav-ior when you open a folder and begin typing:

Automatically Type into the Search Box—Activate this option to have your typingappear in the Search box.

Select the Typed Item in the View—Activate this option to jump to the first itemin the folder with a name that begins with the letter you type.

Moving User FoldersBy default, all your user folders are subfolders of the %USERPROFILE% folder, which isusually the following (where User is your username):

C:\Users\User

This is not a great location because it means that your documents and Windows 7 are onthe same hard disk partition. If you have to wipe that partition to reinstall Windows 7 orsome other operating system, you’ll need to back up your documents first. Similarly, youmight have another partition on your system that has lots of free disk space, so you mightprefer to store your documents there. For these and other reasons, moving the location ofyour user folder is a good idea. Here’s how:

1. Create the folder in which you want your user folder to reside.

2. Click Start, type c:\users\ (replace c with the letter of the drive where your versionof Windows 7 is installed), and then click your username in the search results.Windows 7 displays your user profile folders.

3. Right-click the user folder you want to move, and then click Properties. The folder’sproperty sheet appears.

4. In the Location tab, use the text box to enter the full path (drive and folder name)of the folder you created in step 1. (Or click Move to select the folder using adialog box.)

5. Click OK. If Windows Explorer asks whether you want to create the new folder andthen to move your documents to the new location, click Yes in both cases.

Page 43: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

20 CHAPTER 1 Customizing Windows Explorer

TIP

An ideal setup is to have Windows 7 and your programs in one partition and your docu-ments (that is, your user folders) in a separate partition. That way, your documentsremain safe if you have to wipe the system partition.

Taking Ownership of Your FilesWhen you’re working in Windows 7, you may have trouble with a folder (or a file)because Windows tells you that you don’t have permission to edit (add to, delete, what-ever) the folder. You might think the solution is to give your user account Full Controlpermissions on the folder (see Chapter 17, “Securing the File System”), but it’s not as easyas that. Why not? Because you’re not the owner of the folder. (If you were, you’d have thepermissions you need automatically.) So the solution is to first take ownership of thefolder, and then assign your user account Full Control permissions over the folder.

. See “Setting Security Permissions on Files and Folders,” p. 359.

Here are the steps to follow:

1. Use Windows Explorer to locate the folder you want to take ownership of.

2. Right-click the folder and then click Properties to open the folder’s property sheet.

3. Display the Security tab.

4. Click Advanced to open the Advanced Security Settings dialog box.

5. Display the Owner tab.

6. Click Edit.

7. In the Change Owner To list, click your user account.

8. Activate the Replace Owner on Subcontainers and Objects check box.

9. Click OK. Windows 7 warns you that you need to reopen the property sheet tochange the folder’s permissions.

10. Click OK in the open dialog boxes.

11. Right-click the folder and then click Properties to open the folder’s property sheet.

12. Display the Security tab.

13. If you do not see your user account in the Group or User Names list, click Edit, clickAdd, type your username, and click OK.

14. Click your username.

15. Click the Full Control check box in the Allow column.

16. Click OK in the open dialog boxes.

Page 44: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

21Taking Ownership of Your Files1

Note that, obviously, this is quite a bit of work. If you only have to do it every once in awhile, it’s not big thing, but if you find you have to take ownership regularly, you’ll prob-ably want an easier way to go about it. You’ve got it! Listing 1.1 shows a Registry Editorfile that modifies the Registry in such a way that you end up with a Take Ownershipcommand in the shortcut menu that appears if you right-click any folder and any file.

NOTE

You can find the Registry Editor file (TakeOwnership.reg) on my website at www.mcfedries.com/Windows7Unleashed.

LISTING 1.1 A Registry Editor File That Creates a Take Ownership Command

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]

@=”Take Ownership”

“NoWorkingDirectory”=””

[HKEY_CLASSES_ROOT\*\shell\runas\command]

@=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administra-

tors:F”

[HKEY_CLASSES_ROOT\Directory\shell\runas]

@=”Take Ownership”

“NoWorkingDirectory”=””

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]

@=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant

administrators:F /t”

To use the file, double-click it and then enter your UAC credentials when prompted. Asyou can see in Figure 1.7, right-clicking (in this case) a folder displays a shortcut menuwith a new Take Ownership command. Click that command, enter your UAC credentials,and sit back as Windows does all the hard work for you!

Page 45: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

22 CHAPTER 1 Customizing Windows Explorer

Running Custom SearchesWhen you open a folder window, you know that you can click inside the Search box, typesome text, and you get a list of files and folders that match your text. This worked well inWindows Vista, but it really rocks in Windows 7 because the latest version of the DesktopSearch engine is even faster. However, simple text searches aren’t going to radically boostanyone’s productivity or help you find a file needle in a hard disk haystack. To takesearching to the next level, you need to know about two obscure but powerful searchfeatures: Advanced Query Syntax and natural language queries.

Using Advanced Query Syntax to Search Properties

When you run a standard text search from any Search box, Windows looks for matchesnot only in the filename and the file contents, but also in the file metadata: the propertiesassociated with each file. That’s cool and all, but what if you want to match only aparticular property. For example, if you’re searching your music collection for albums thatinclude the word Rock in the title, a basic search on rock will also return music where theartist’s name includes rock and the album genre is Rock. This is not good.

FIGURE 1.7 When you install the Registry mod, you see the Take Ownership command whenyou right-click a file.

Page 46: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

23Running Custom Searches1

To fix this kind of thing, you can create powerful and targeted searches by using a specialsyntax—called Advanced Query Syntax (AQS)—in your search queries.

For file properties, you use the following syntax:

property:value

Here, property is the name of the file property you want to search on, and value is thecriteria you want to use. The property can be any of the metadata categories used byWindows. For example, the categories in a music folder include Name, Track, Title, Artists,Album, and Rating. Right-click any column header in Details view to see more propertiessuch as Genre and Length, and you can click More to see the complete list.

Here are a few things to bear in mind:

. If the property name is a single word, use that word in your query. For example, thefollowing code matches music where the Artists property is Coldplay:

artists:coldplay

. If the property name uses two or more words, remove the spaces between the wordsand use the resulting text in your query. For example, the following code matchespictures where the Date Taken property is August 23, 2009:

datetaken:8/23/2009

. If the value uses two or more words and you want to match the exact phrase,surround the phrase with quotation marks. For example, the following code matchesmusic where the Genre property is Alternative & Punk:

genre:”alternative & punk”

. If the value uses two or more words and you want to match both words in anyorder, surround them with parentheses. For example, the following code matchesmusic where the Album property contains the words Head and Goats in any order:

album:(head goats)

. If you want to match files where a particular property has no value, use emptybraces, [], as the value. For example, the following code matches files where the Tagsproperty is empty:

tags:[]

You can also refine your searches with the following operators and wildcards:

> Matches files where the specified property is greater than the specified value. Forexample, the following code matches pictures where the Date Taken property islater than January 1, 2009:

datetaken:>1/1/2009

Page 47: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

24 CHAPTER 1 Customizing Windows Explorer

>= Matches files where the specified property is greater than or equal to the speci-fied value. For example, the following code matches files where the Size propertyis greater than or equal to 10000 bytes:

size:>=10000

< Matches files where the specified property is less than the specified value. Forexample, the following code matches music where the Bit Rate property is lessthan 128 (bits per second):

bitrate:<128

<= Matches files where the specified property is less than or equal to the specifiedvalue. For example, the following code matches files where the Size property isless than or equal to 1024 bytes:

size:<=1024

.. Matches files where the specified property is between (and including) two values.For example, the following code matches files where the Date Modified property isbetween and including August 1, 2008 and August 31, 2008:

datemodified:8/1/2008..8/31/2008

* Substitutes for multiple characters. For example, the following code matchesmusic where the Album property includes the word Hits:

album:*hits

? Substitutes for a single character. For example, the following code matches musicwhere the Artists property begins with Blu and includes any character in the fourthposition:

artists:blu?

AND (or+)

Use this operator to match files that meet all of your criteria. For example, thefollowing code matches pictures where the Date Taken property is later thanJanuary 1, 2009 and the Size property is greater than 1000000 bytes:

datetaken:>1/1/2009 AND size:>1000000

OR Choose this option to match files that meet at least one of your criteria. Forexample, the following code matches music where the Genre property is eitherRock or Blues:

genre:rock OR genre:blues

For even more sophisticated searches, you can combine multiple criteria using Booleanoperators:

Page 48: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

25Running Custom Searches1

NOTE

The Boolean operators AND, OR, and NOT must appear with all-uppercase letters inyour query.

Using Natural Language Queries

In the preceding section, I showed you how to use advanced query syntax to createpowerful search queries. The only problem is that it’s a chore having to memorize allthose operators and what they’re used for. If you’re not up for all that, Windows 7 offersan alternative. It’s called natural language search, and it enables you to perform complexsearches without using any operators. Sweet!

First, follow these steps to turn on natural language search:

1. If you have a folder window open, select Organize, Folder and Search Options (orTools, Folder Options if you have the menu displayed; otherwise, click Start, typefolder, and then press Enter to select Folder Options in the search results). TheFolder Options dialog box appears.

2. Select the Search tab.

3. Activate the Use Natural Language Search check box.

4. Click OK to put the new setting into effect.

Crafting natural language queries is a bit of a black art because Microsoft has no documen-tation available. Feel free to experiment to get the feel of these queries.

A basic natural language query looks like this:

adjective kind verb value

Here, adjective is an optional value that narrows down the search, usually by using avalue from a property (such as a genre for music or a file type for images); kind is the typeof file, such as music or images; verb is a verb that more or less corresponds to the propertyyou want to match, such as modified (the Date Modified property), (the Date Created prop-erty), from (the From property in an email), and by (the Artist property in a music file);and value is the specific value you want to match.

For example, if you want to return all the pop music done by the band Sloan, you’d enterthe following query:

pop music by sloan

NOT(or –)

Choose. For example, the following code matches pictures where the Type prop-erty is not JPEG:

type:NOT jpeg

Page 49: Microsoft Windows 7 - ecx.images-amazon.comecx.images-amazon.com/images/I/A1lSMEuVtgS.pdf · Microsoft ® Windows 7 UNLEASHED ... 13 Controlling Windows 7 from the Command Line

26 CHAPTER 1 Customizing Windows Explorer

Similarly, if you want all the JPEG images that were created today, you’d use the followingquery:

jpeg images created today

You can keep adding more properties and values to target your searches. For example, ifwe want our Sloan search to return only those songs rated with five stars, we’d modify thesearch as follows:

pop music by sloan rating *****

You can still perform Boolean searches in natural language queries. For example, if youwant documents where the Author property includes Paul or Karen, you’d use thefollowing query:

documents by paul or karen

Similarly, if you want to return all your videos except those in the QuickTime format,you’d use the following:

videos not quicktime

NOTE

Unlike with AQS, the Boolean operators or and not can appear in lowercase letters.(The Boolean operator and is implied in all multiterm natural language queries, so younever have to use it.)

Finally, note that when you’re working with dates, there are several keywords you can usein your natural language queries, including the following: yesterday, today, tomorrow,week, month, year, last, this, and next. For example, if you want to see all the TIFFimages created this week, you’d use the following:

jpeg images created this week