wiki:windows/configuration

Version 38 (modified by joergs, on Feb 14, 2012 at 1:21:10 PM) ( diff )

updates -> wiki:windows/updates

Windows Configuration

Remarks about how to configure Windows, mainly from generating OPSI packages.

Silent Installation

Overview about the different installers:

Silent Uninstall

Silent Uninstall using wmi

C:\>wmic
wmic:root\cli>product get name,version
Name                                                            Version
WebFldrs XP                                                     9.50.7523
Java(TM) 6 Update 20                                            6.0.200
TeamViewer 6 (MSI Wrapper)                                      6.0.11052
...

wmic:root\cli>product where name="WebFldrs XP"
Caption      Description  IdentifyingNumber                       InstallDate  InstallDate2               InstallLocation  InstallState  Name         PackageCache                    SKUNumber  Vendor                 Version
WebFldrs XP  WebFldrs XP  {350C97B3-3D7C-4EE8-BAA9-00BCB3D54227}  20110906     20110906000000.000000-000                   5             WebFldrs XP  C:\WINDOWS\Installer\2e182.msi             Microsoft Corporation  9.50.7523

wmic:root\cli>product where name="WebFldrs XP" call uninstall /nointeractive

Hardware Information

wmi / wmic

Prodcut Name (computer type)

# get computer system product information
wmic csproduct get

# get computer system product name, eg. Latitude D420
wmic csproduct get name /format:value

From OPSI:

[Actions]
DefStringList $ResultList$
DefVar $HardwareSystemType$
set $ResultList$ = getOutStreamFromSection('DosInAnIcon_get_hardware_system_type')
set $HardwareSystemType$ = trim( getValue( "Name", $ResultList$ ) )

[DosInAnIcon_get_hardware_system_type]
wmic csproduct get name /format:value

Computer Type (chassis type)

returns number of chassis type:

wmic systemenclosure get chassistypes

Values meaning:

;1 Other 
;2 Unknown 
;3 Desktop 
;4 Low Profile Desktop 
;5 Pizza Box  
;6 Mini Tower 
;7 Tower 
;8 Portable 
;9 Laptop 
;10 Notebook 
;11 Hand Held 
;12 Docking Station 
;13 All in One 
;14 Sub Notebook 
;15 Space-Saving 
;16 Lunch Box  
;17 Main System Chassis 
;18 Expansion Chassis 
;19 SubChassis 
;20 Bus Expansion Chassis 
;21 Peripheral Chassis 
;22 Storage Chassis 
;23 Rack Mount Chassis 
;24 Sealed-Case PC 

Laptop or Desktop?

If ChassisType==8 || ChassisType==9 || ChassisType==10 
	Message(ChassisType,"Is a Laptop")
Else
	Message(ChassisType,"Is not a Laptop")
EndIf

Another approach is to check if computer has a battery or not:

wmic path win32_battery  get
wmic path win32_battery  get Description

systeminfo

systeminfo /?

Screensaver

user specific

wmic desktop

Powersettings

to change power settings, the user must have the write permission for the following registry subkeys:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg
    HKEY_ USERS\.DEFAULT\Control Panel\PowerCfg

see http://xpregistry.uw.hu/xpr0035.html

powercfg

powercfg
  • only user specifc
  • not all settings can be configured

see http://technet.microsoft.com/en-us/library/cc748940%28WS.10%29.aspx

executing program on remote system

wmic /node:"%1" /user:bob.carroll process call create "cmd.exe /c whatever.exe"

Standard components

Tools

rsync, ssh

includes a rsync and ssh for Windows (and the DeltaCopy frontend/server) . These tools are based on Cygwin. These tools doesn't need installation. fter settings the path variable to the DeltaCopy directory, these tools are usesable.

Registry

Structure

What are Control Sets? What is CurrentControlSet?

use CurrentControlSet, see http://support.microsoft.com/kb/100010

Tools

regdiff

# compare 2 registry files and generate a new file which only contains the differences
regdiff  file1.reg file2.reg -4 -d diff.reg

Attention: does diff.reg contain what is set in file2 or in file1? I expect file2, but had the content of file1 once. CHECK THIS.

see http://p-nand-q.com/download/regdiff.html

regmon

Infos

Batch

Note: See TracWiki for help on using the wiki.