Maintaining Windows XP
System Maintenance Tasks on Windows XP
Contents
Activating Windows XP
Top Bottom- antipiracy feature (one copy of XP can be installed on one PC only)
- must be done within 30 days by internet or phone
- after 30 day grace period, users can log on to PC, but can do nothing until product activated
- automatic and instantaneous
- allowed to reinstall on same hardware
- once registered the CD can not be used to install to another PC
- ID created from CD product ID and hardware ID
- encrypted file serves as fingerprint (wpa.dbl and wpa.bak): includes video, hdd, ide, CD, nic, CPU, RAM
- if you replace 4/10 components within 120 days, the activation mechanism may assume you've cloned the setup to another machine
- OEM software may be exempt from WPA
- volume licensing media exempt from WPA
- restore wpa.dbl to bypass activation
- restore wpa.bak to restore system to previous activated state
- Msinfo32 display activation status if product not activated, and an 'Activate' icon appears in the notification area
Files and Settings transfer Wizard
Top Bottom- Save settings from any 32-bit windows
- restore to XP
- Direct connection, serial or Ethernet or save settings to a file
- Do administrator account first, to capture file associations, then do additional accounts one-by-one
- migrates user-specific settings (visual settings, folder and taskbar options; accessibility options; phone, modem and network connections; network printers and drives)
- internet settings: favourites and cookies
- email: collects account settings, messages and contacts from Outlook
- application settings: registry settings and preference files. Used once application is re-installed. List of applications is stored in %systemroot%\system32\usmt\migapp.inf
- Files and Folders: my docs and my pics, shared documents plus a list of extensions is used to determine what other files are copied
- Prefer folders to file types
- Can be used with custom settings to backup your PC
Migration Process:
- Programs: Accessories: System Tools: Files and Settings Transfer Wizard on new computer (or %systemroot%\system32\usmt\migwiz from command prompt).
- Choose 'New Computer' option
- Choose 'I will use the wizard from the XP CD'
- At old computer, insert XP CD(use wizard disk on old PC if it has no CDROM). Choose 'Additional Tasks: Transfer Files' from Welcome Screen. Choose 'Old Computer' option. Or run fastwiz.exe from XP CD in support\tools
- Choose transfer method
- Choose between files only, settings only, files and settings. The list will vary according to the transfer method
- Password generated on new computer to prevent files from being stolen
- to restore files to new computer from file, start transfer wizard and select 'I don't need a wizard disk'. Specify location and continue
Automatic Updates
Top Bottomthree options:
- auto download, notify install
- notify both
- disable
View updates in Help Centre, windows updates link. Restore declined updates available via sysdm.cpl: Automatic Updates
Accessibility Options
Top Bottom- magnifier (can follow mouse and keystrokes)
- narrator (text-to-speech utility)
- on screen keyboard (used with mouse or joystick)
- accessibility wizard (used to select text size, display settings, choose deaf or blind, scroll bar size, icon size, display colour, mouse cursor, SoundSentry or ShowSounds, StickyKeys, FilterKeys (or BounceKeys), ToggleKeys, and MouseKeys)
- Utility Manager (Win+U) to control magnifier, narrator and OSK prior to login
AddRemove Components
Top BottomWindows installs a standard set of components.
Default Install:
- Accessories
- Indexing Service
- IE
- MSN Explorer
- Update Root Certificates
Not Installed:
- Fax Services
- IIS
- Management and Monitoring Tools
- Message Queuing
- Networking Services
- Other Network and Print Services
Other hidden components can be revealed in Add/Remove by editing; %SystemRoot%\inf\sysoc.inf
System Restore
Top BottomSystem Restore (found in sysdm.cpl)
- Drive space used: default 12%
- default location: \system volume information\
- each restore point in a separate folder: '_restoreGUID'
- restore folders are accessible to system account only
- drives to be monitored. Data only files should be excluded
- by default excludes 'my Docs' and '%systemroot%\downloaded program files'
- specify other excluded areas by regedit: HKLM\System\CurrentControlSet\BackupRestore\FilesNotToBackup. Doesn't take affect until you set next restore point
- Shuts down if space on any drive <200MB. Doesn't automatically restart. Restart via sysdm.cpl
Startup Options
Top BottomStartup Options, controlled via sysdm or boot.ini:
- start time: -1, wait forever; 0, don't display; 1-99 seconds
- /fastdetect: don't detect serial mice
- /noguiboot: eliminate windows splash screen
- /sos: display driver load and hardware detect
- /safeboot
install the command console using the XP CD
Startup Process:
- PC performs POST
- POST for each adapter with own BIOS
- BIOS reads MBR (first sector on first hard disk) and transfers control to code in MBR
- MBR reads boot sector (first sector of active partition) which contains code that starts NTLDR
- NTLDR switches system to protected mode with paging enabled, starts the filesystem, reads boot.ini and displays menu . NTLDR, Ntdetect.com, boot.ini, bootsect.dos (dual boot only), ntbootdd.sys (SCSI only) must all be in root of active partition
- Selecting NT causes NTLDR to run ntdetect.com to gather info about installed hardware
- NTLDR then uses ARC (Advanced RISC Computing) path to find the boot partition and loads the core: Ntoskrnl.exe and Hal.dll (from %systemroot%\system32)
- NTLDR continues reading the registry, selecting hardware profile and control set and loading device drivers
- ntoskrnl takes over and starts winlogon.exe, which in turn starts lsass.exe (local security administration) which displays welcome/logon screen
Removing Recovery Console (if installed)
- edit boot.ini
- delete cmdcons folder
- delete cmdldr from root directory
Help and Support
Top BottomHelp and Support Centre: consists of around 10,000 individual topics from 200 chm (compiled html) files. Uses two related modules:
- service - helpsvc.exe and
- executable: helpctr.exe
If help centre stops working, kill all helpctr processes and restart helpsvc. Searches provide results by:
- suggested topic: match to keywords in help files
- full-text matches: content matching
- MS KnowledgeBase
Use quotes to find a particular phrase. Search supports Boolean operators. Or click index button to search index. Customisation options for help centrer:
- change help centrer options
- change search options
- install and share help: install help files from XP Home and 2003
Graphical Help on Commands: “%systemroot%\pchealth\helpctr\binaries\helpctr /url ms-its:%systemroot%\Help\ntcmds.chm::/ntcmds.htm”
- net (user | localgroups)
- driverquery /v /fo csv > drvlist.csv (produces list of drivers)
- command (switch to 16-bit console)
- osk (on screen keyboard)
- schtasks – allows you to configure scheduled tasks on local and remote computers (you can also schedule tasks on remote machines via network neighbourhood)
Remote Assistance
Top BottomRemote Assistance: uses XP Terminal Services to share desktop: both users must be present and agree connection. Remote Assistance available on both Home and Pro, but RDP only on Pro. To use Remote Assistance:
- both must be using XP
- both must have active internet connection
- neither can be blocked by Firewall
- novice sends invite
- expert accepts opening read-only view
- expert and novice can use chat screen
- expert requests to take control
- novice accepts request
- novice can kill connection at any time by pressing escape
The RA ticket (.msrincident) uses XML to define parameters of connection. Uses port 3389. ICF automatically opens this port when request sent. If using private address behind NAT device, things get complicated:
- ICS listens for remote assistance on 5001 and forwards to 3389
- UPnP-compatible hardware router should work
- non-UPnP probably won't
- Dynamic IP addresses are also problematic
With windows messenger, list of contacts appear in remote assistance pane. Once connected they don't need a password as they get authenticated with passport. Request can also be sent to contacts in address book, with option to set password and expiry date. Invitation can be saved to a file. Remote Assistance can be dis/enabled via sysdm.cpl
Installing Software
Top Bottomedit sysoc.inf to see all programs that can be added\removed
Windows File Protection detects attempts to replace a protected system file (files installed by the Windows setup program). Windows checks the digital signature on the file. If the file is not the correct version, it is replaced with one from the dllcache folder, or from the XP CD, or you'll be prompted for the location. Activity of Windows File Protection is logged to event log. sfc command can be used to scan and verify the versions of all system files:
sfc switches:
/scannow (scans immediately)
/scanonce (scans once)
/scanboot (scans on each reboot)
/revert (returns to default operation)
/purgecache (purges WFP cache and does an immediate scan)
/cachesize=x
Use file signature verification options (block, ignore, warn) to control behaviour.
Some legacy applications work after an upgrade but refuse to install on a clean install. Changes mainly in area of compatibility. Software using VxDs won't run. Limited user can install only if:
- files are copied to user profile
- registry settings affect HKCU
Power users should be able to install most apps, unless they write to crucial parts of registry or filesystem. Set a restore point before installing a dodgy program. On corporate networks, the Add/Remove programs tab also lists applications that have been assigned or ed. Assigned programs are automatically installed when a user selects the program from the programs menu, or by opening a document with associated extension.
16-bit programs
- run in a subsystem, a virtual machine that mimics 386 enhanced mode
- most 16-bit programs do not support long file names. XP maintains links, to preserve long file names when a 16-bit program saves a file
- 16-bit programs are restricted to using a single thread. 16-bit calls must be translated for the 32-bit OS (thunking) which adds to execution time
- 16-bit applications require 16-bit device drivers which are not supported in XP. Application must provide 32-bit drivers to work.
- 16-bit dlls cannot be used by 32-bit apps and vice versa. If you have Word6 documents with macros that access certain dlls, they won't work with Word2000's dlls.
- 16-bit apps don't have a version tab
- 16-bit applications appear in Task Manager under NTVDM.exe and WOW.exe (windows on windows)
- Multiple 16-bit apps share a common memory space: a crash in one will crash all. Programs can be run in a separate memory space
- command.com is the 16-bit version of cmd.exe
- %systemroot%\_default.pif is the default pif file
- _default.bat is the batch file that runs each time an MSDOS program starts
- Custom pifs appear in the same directory as the program
- autoexec.nt and config.nt control virtual machine setup. Custom versions can be entered in programs pif
The properties tab of an executable contains a compatibility mode option. Compatibility options try to fool a program into thinking its running on an earlier version of windows. Application Compatibility Wizard found in Accessories or properties of program shortcut: basic purpose to configure support for downlevel applications. Application compatibility tool uses four databases to filter application code before it reaches the operating system.
If properties displays a version tab, then its a 32-bit program
Run As: 'runas /user:username cmd' or right-click program and select 'run as'. A handful of programs are started by Windows, and do not therefore support runas.
MSI contain all the files required to install a package and can be deployed using Group Policy(softwaresettings\softwareinstallation). In AD Users and Computers, assign or publish a package to users (you can not publish software to computers) by creating a new group Policy for domain or OU and configure software installation (add new package, use unc path). MSI should be stored in a network share.
CHKDSK
Top Bottomchkdsk - without switches: read only, report only. Available switches:
- /f fix errors
- /v verbose
- /r recover info from bad sectors
- /i check index entries only
- /c skips checking cycles within the folder structure
- /x forces the volume to dismount, invalidates all open filehandles
Autochk.exe runs automatically when you schedule a disk check at startup.
chkntfs.exe /x d: cancel a scheduled check at startup
NTFS volumes keep a journal of all disk activities. A registry bit can be set to indicate that the file system is 'dirty' (contains data that was not properly read/written). If this dirty bit is set, then XP will run chkdsk automatically on restart.
Defragmentation
Top BottomDefragmentation: Formatting a disk divides it into sectors, each of which contains space for 512 bytes of data. Filesystems combine sectors into groups or clusters, the smallest unit of space available for holding a data. A 10GB NTFS partition uses 4KB clusters, thus a 20GB file will require 2,500 clusters. Fragmentation occurs when a file is spread across non-contiguous clusters.
defrag d:
- /a (analyze and display analysis report)
- /v (display complete report, defrag and analysis)
- /f (force defragmentation)
Defragmentation requires 15% free space for full defragmentation. A dirty disk cannot be defragmented: run chkdsk first. Defrag does not touch the recycle bin: empty it first. Nor will it defrag bootsect.dos, safeboot.fs, safeboot.csv, safeboot.rsv, hiberfil.sys, memory.dmp or pagefile.sys. Defrag may require several runs to fully defrag a large file. Will not defrag open files either.
Disk Cleanup
Top BottomDisk Cleanup: when windows is running low on disk space, a warning is displayed in the notification area. Double click the warning icon to start the disk cleanup wizard. Wizard will not delete files from %temp% that are less than a week old. The more options tab take you to either Add/Remove programs or will allow you to remove all but the last system restore point.
cleanmgr:
- /d driveletter
- /sageset:n where n is an arbitrary number between 1 and 65535, used to create a registry key to save cleanmgr settings
- /sagerun:n run saved settings
MSC Commands
Top Bottom- lusrmgr.msc
- devmgmt.msc
- compmgmt.msc
- secpol.msc (security policy)
- gpedit.msc (local computer/group policy)
- certmgr.msc (certificates)
- ciadv.msc (indexing service)
- dfrg.msc
- diskmgmt.msc
- eventvwr.msc
- fsmgmt.msc (shared folders)
- ntmsmgr.msc (removable storage)
- ntmsoprq.msc (removable storage operator requests)
- perfmon.msc
- rsop.msc (resultant set of policy)
- services.msc
- wmimgmt
CPL Commands
Top Bottom- odbccp32.cpl (try odbcad32.exe instead)
- ncpa.cpl
- access.cpl (accessibility)
- hdwwiz.cpl (add/detect hardware wiz)
- appwiz.cpl (add remove software)
- sysdm.cpl (system properties)
- timedate.cpl (date and time properties)
- desk.cpl (display properties)
- rundll32.exe shell32.dll,Options_RunDLL 1 (taskbar and start menu)
- joy.cpl (configure joystick)
- inetcpl.cpl (configure ie properties)
- mmsys.cpl (multimedia properties)
- main.cpl (mouse properties)
- intl.cpl (internationalisation)
- telephon.cpl (phone and modem options)
- powercfg.cpl (power options)
- irprops.cpl (wireless connections)
- nusrmgr.cpl (user accounts)
Control Commands
Top Bottom- control printers (open printers folder)
- control scannercamera (scanners and cameras)
- control schedtasks
- control netconnections (try ncpa.cpl instead)
- control speech (speech properties)
- control main.cpl,@1,1 (keyboard properties)
- control admintools (administrative tools folder)
- control folders (folder options)
- control fonts (open fonts folder)
- control (userpasswords | userpasswords2)
