• No results found

Windows 7 Portable Command Guide: MOTS , and MCITP

N/A
N/A
Protected

Academic year: 2021

Share "Windows 7 Portable Command Guide: MOTS , and MCITP"

Copied!
9
0
0

Loading.... (view fulltext now)

Full text

(1)

Windows

7

Portable Command

Guide:

MOTS

70-680,

and MCITP 70-685

and 70-686

Darril Gibson

800 East 96th Street

(2)

INTRODUCTION 1

PART I:Command PromptBasics

CHAPTER 1

Launching

and

Using

the CommandPrompt 3 Launchingthe Command

Prompt

3

Pinning

the Command

Prompt

to the StartMenu and theTaskbar

Launching

the Command

Prompt

with Elevated

Privileges

4 Respondingtothe UAC

Prompt

5

Usingthe Built-inDoskey

Program

7

Creating

Mini Macros in

Doskey

9

Copyingfrom andPastinginto the CommandPrompt 9

Copy

from the Command

Prompt

Window 10 Paste Textintothe CommandPromptWindow 10

Changing

theOptions and

Display

oftheCommand Prompt 11

CHAPTER 2 Basic Rules When

Using

the Command

Prompt

15 Using UppercaseorLowercase 15

Using

QuotestoEnclose

Spaces

16

Understanding Variables 17

Understanding Switches 18

Understanding

Wildcards 18

Getting

Help 19

CHAPTER3

Using

Basic Commands 27

Understanding Folders and Directories 27

Understanding Paths 28

ViewingFiles and Folders withdir 30 Changingthe Path with cd 31

Using DragandDropto theCommand

Prompt

Window 32 DeletingFolders with rd 33

CreatingFolders with md 33

Controlling Output

with more 34

Redirecting Output 35

Usingthe RedirectSymbol(>) 35

Using clip 35

(3)

vi Contents

PARTII:Workingwith

Files,

Folders,and Disks

CHAPTER 4 Manipulating Files and Folders 37

AssociatingFileExtensions withassocandftype 37 assoc 39

ftype 39

ViewingAttributes with attrib 4 i

Compressing

Files withcompact 43

Encrypting

Files with

cipher

44

Copying

Files with copy, xcopy, androbocopy 46

copy 46

xcopy 47

robocopy

48

Deleting

or

Removing

Files withdel 50

ExpandingCabinet Fileswithexpand 51

Taking Ownership

of Files withtakeown 51

Removing

the Windows.oldFolder 52

MappingDrives withnetuse 53

CHAPTER5 Manipulating Disks 55

ManipulatingandViewingDisks withdiskpart 55 CreatingaVHD File with

diskpart

56 Modifyingthe BCDStore for the VHD File 57

Defragmenting Volumes withdefrag 59 ConvertingtoNTFS with convert 61 Managingthe File Systemwith fsutil 62

PART III:

Scripting

withBatchFiles

CHAPTER6

Creating

Batch Files 63

Using

Notepad 63

Giving

Feedback with echo 64 UsingParameters 65

Calling

AnotherBatch File with call 68

Clearing

the Screen with els 69

Changingthe Order ofProcessingwith goto 69

Checking

Conditions with if 70

Logging

Events with eventcreate 73

Looping

ThroughTasks with for 75

(4)

CreatingaMenu File 76

Documenting the

Script

with rem 76

Pausing

fortheUser 77 GivingUsers a Choice 77

Creating

the Batch File 78 CHAPTER7

Scheduling

Batch Files 81

Scheduling

Batch Files with Task Scheduler 81 SchedulingTasks from the Command Line 82

Creating

aScheduled Task with schtasks 83

Creating

aScheduledTask fromanXML File with schtasks 83

Deleting

aScheduledTask with schtasks 85

Viewing

Scheduled Tasks with schtasks 85

Changing

Scheduled Tasks with schtasks 86

Running

and

Ending

ScheduledTasks with schtasks 87

PART IV:Managing and

Maintaining

Windows 7

CHAPTER8

Using

Windows 7 Maintenance Tools 89

Controlling

Power

Settings

with

powercfg

89

Query

the Power

Settings

withpowercfg 89

Modify

the PowerSettingswith

powercfg

91

Analyze

the Power

Settings

with

powercfg

93

Checking Memory

with mdsched 93

Manipulating

Services withsc 95

CollectingEvents with wecutil 97

Restarting Systems

with shutdown 97

LaunchingControl Panel Appletsfromthe Command Line 99

CHAPTER9 RetrievingInformation About Windows 7 103 Viewing

System

Information withsysteminfo 103 ViewingUser Information with whoami 106 Launching System Configurationwithmsconfig 107

CHAPTER 10 Managing Securityin Windows7 111

ManipulatingCredentials withcmdkey 111

Installing Updates

withwusa 112

Installing

Applications

with msiexec 115 Auditing Systemswith mbsacli 116

(5)

viii Contents

CHAPTER11

Configuring

Windows 7 with netsh 121

Understanding

netsh 121

Understanding

Contexts 122 Configuringa

Proxy

Server 126

Configuring

the Network Interfacewithnetsh 126 PART V:TroubleshootingWindows7

CHAPTER 12 ConfiguringWindows 7Using BasicTroubleshootingTools 135

IdentifyingtheSystemNamewith hostname 135

VerifyingCoreSystemFiles with sfc 135

Checking Digital Signatureswithsigverif 137

ViewingActive Tasks with tasklist 138

TerminatingProcesses withtaskkill 142

ViewingInstalledDrivers with

driverquery

144

CHAPTER 13 Troubleshooting Network Issues 145

Viewing

andManipulatingTCP/IPConfigurationwithipconfig 145

Viewing thePhysicalAddress withgetmac 151

Checking Connectivitywithping 152

Viewingthe Router Path with tracert 155

Checkingfor Data Loss withpathping 155 Checkingfor Records inDNS withnslookup 156 CHAPTER14

Using Recovery

Tools 161

Manipulating

the BootProcess with bcdcdit 161 Commands ThatOperateon aStore 165

Commands That ControlOutput 166

Commands That Control the BootManager 167

Commands ThatOperateonEntries in the Store 169

Commands That

Operate

onEntry Options 170 Disable Driver

Signing

170

Creating

a

System Repair

Discwithrecdisc 171

CheckingandRepairingDisks with chkdsk 172 Repairing BitLocker Drives withrepair-bde 175

(6)

PART VI: Remote Administration

CHAPTER 15

Managing

Remote Windows 7

Systems

177

Configuring

Windows 7 for Remote Administration 177

ConfiguringSystem forRemoteDesktopConnection (RDC) 177

Configuring System for Remote Access

Using

anMMC 180

ConnectingtoRemoteSystemswith mstsc 181

ConfiguringWindows Remote Management with winrm 184 ExecutingCommandsRemotelywithwinrs 185

CHAPTER 16 Windows

Management

InstrumentationCommand Line 187

Understanding

wmic 187

ConfiguringtheFirewallto Allow wmic 188

Runningwmic 189

Modifying the Format with the/format Switch 191 Retrieving Helpfrom wmic 194

UnderstandingAliases 194

Operating

SystemAliases 196

Disk Drive Aliases 197

System

Hardware Aliases 198

User,Group,and Domain Aliases 200

UsingVerbs 200

PARTVII:

Creating

and

Managing Images

CHAPTER 17

Understanding Images

203 UnderstandingWIM Files 203

Using WindowsDeployment Services andImages 205

Comparing

Boot and Install Images 207

Comparing

Thick and ThinImages 213

CHAPTER 18

Preparing

aSystemto Be

Imaged

with

Sysprep

215

Understanding

Sysprep

215 Runningthe SysprepGUI 216

(7)

x Contents

CHAPTER 19

Installing

the Windows Automated Installation Kit 221

Downloadingthe WAIK 221 Installingthe WAIK 221 Viewingthe WAIK Tools 224

CHAPTER20 Using imagex 227

CreatingWinPEon aBootable USB 227

Capturing

Imageswithimagex 231

Appending

Imageswithimagex 233

Deleting Images withimagex 235

Deploying

Images withimagex 235

CHAPTER 21 UsingtheDeployment ImageService and

Management

(DISM)Tool 237

OnlineServicingVersus Offline

Servicing

237 Mounting Images 238

GettingInformationAbout Mounted

Images

240 Modifying Images 240

Workingwith Drivers 241

WorkingwithPackagesandFeatures 242

MiscellaneousImageModifications 244 Saving Images 245

PART VIII: Workingwith WinPE and

Setup

CHAPTER 22 WinPE Commands 247

AddDriverstoWinPE with drvload 247

RunCommands Within WinPE with

wpeutil

248

CHAPTER 23

Installing

Windows 7 with setup 251 InstallingWindows7with setup 251

Using

the Autounattend.xml File 252

Using slmgr

253

Basic slmgr Commands 254 slmgrActivation Commands 255

slmgr

Commands Used for KMS Clients 256

(8)

PARTIX: MigratingUser Data with USMT

CHAPTER 24

Capturing

User Data with scanstate 259

Understanding Migration

Stores 259

Reviewing Migration

Paths 259

Understanding

Hard-Link

Migration

Stores 263 Capturing

Migration

Data with scanstate 265

Specifying

XML Files 266

Modifying

XML Files 266

Identifying

UserstoMigratewith scanstate 268

Encrypting

theMigrationStore withscanstate 269

Simple

Error Handlingwith scanstate 270

Handling

EFS Files 270

Migrating

Data from theWindows.old Folder 271 CHAPTER 25

Restoring

User Data with loadstate 273

Runningloadstate 273

Specifying

XML Files 274 SpecifyingHard-Link

Options

275 Deletingthe Hard-LinkStore 275 IdentifyingUsersto

Migrate

276

Decryptingan

Encrypted Migration

Store 277 HandlingErrors 278

PART X:UsingPowerSheH

CHAPTER 26

Understanding

PowerShellCommands 279

Launching

PowerShell 279

UnderstandingPowerShell Verbs andNouns 280

Tabbing

ThroughPowerShell Commands 284

Understanding

the DifferentTypesof PowerShellCommands 285 CreatingAliases 286

Discovering

Windows PowerShellCommands 286

Exploring get-member

288

Redirecting Output

with Windows PowerShell 291

Understanding

PowerShell Errors 291

Understanding

PowerShellVariables 293

Using

Comparison Operators

295

(9)

xii Contents

CHAPTER27

Using

the

Integrated Scripting

Environment

(ISE)

299 Launching the ISE 299

Exploring

the ISE 300

ExecutingCommands in the ISE 302 Creatingand

Saving

a

Script

in the ISE 303

CHAPTER 28

Creating

and

Running

PowerShell

Scripts

309 Settingthe SecurityContext 309

Creating

aPowerShell Profile 310

CreatingandModifyingthe Global PowerShellProfile 312

RunningPowerShellScripts 313 FlushingtheDNS Cache 314

CreatingaListof DomainComputers 315 LoggingProcesses with aget-processScript 316 Testingfor the Existence ofaFile 318

Creating OutputasHTML 318

Runninga Script Against Multiple Computers 320 CreatingaPowerShellMessage Box 322 SchedulingPowerShell

Scripts

326

PART XI:Group Policyand the Command Line

CHAPTER 29 Group PolicyOverview 329

Understanding Group Policy Settings 329

BlockingInheritance 333

Enforcing GPOs 334

Using Loopback Processing 335

Running Scripts

withGroup Policy 336

Running

PowerShellScriptsviaGroup Policy 339

CHAPTER 30 Group PolicyCommand-Line Tools 341 Viewing Group Policy Settingswithgpresult 341 Refreshing Group Policy Settingswithgpupdate 343 APPENDIXA Create Your Own JournalHere 347

References

Related documents

The most important finding our group arrived at is that students who are members of Greek life at UIUC overwhelmingly believe the benefits they receive from their membership are

Tasks are created by selecting Create Basic Task, Create Task, or Import Task from the Actions pane in the Task Scheduler snap-in.. When creating a task, there are five tabs of

In task scheduler you can specify the command line arguments Go to task scheduler double click on your task - Go to 'Actions' - Select your action - 'Edit' - 'Add Argumenets' This

Once setup is complete, an Automate G/L Consolidation can be scheduled as a task using the Windows Task Scheduler program.. A full explanation of the Windows Task Scheduler is beyond

Data Flow Task Task Tasks Custom Tasks Log Providers msdb Database .dtsx File Data Sources Enumerators Task Task Container Task SSIS Runtime SSIS Service Command Line

The central support point (value of 1.5) receives a prior weight of 0.5 and prior weights on upper and lower support points are set such that the mean of the prior distribution

Scheduled tasks are now created via the Task Scheduler program in Windows Server 2008. This is located within the Administrative Tools folder in

How batch files sequentially from windows setx command call statement in fact, statements of passing input defined parameter called program is.. Here the command line will it