Saturday, April 23, 2011

Backup Exclusions in Windows 7 Backup

Windows 7 excludes files from backing up to a snapshot based on the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToSnapshot


Example files Windows 7 excludes by default are WTV files.

Friday, April 8, 2011

Logs, logs, logs - Location of Various Log Files on Windows

The location of various log files on Windows are in the local user's temp folder.

e.g. In most cases, the Windows Installer log files start with msi, end with a .log extension, and includes a group of characters. For example, the Windows Installer log will have a file name that resembles the following: msib3a6g.log.
These log files are located at %temp%, i.e.
  • XP:
    • C:\Documents and Settings\ {UserName} \Local Settings\Temp\
  • Vista:
    • C:\Users\{UserName\AppData\Local\Temp
  • Windows 7:
    • C:\Users\{UserName\AppData\Local\Temp

 
See this link for turning on full verbose logging for Windows Installer:
 

Monday, March 14, 2011

Obtain a Character from a String - DOS Batch File


SET WORDTEMP=RandomWord

REM Get the first character of the word
ECHO WORDCHAR=%WORDTEMP:~0,1%

REM Get the 2nd character of the word
ECHO WORDCHAR=%WORDTEMP:~1,1%

REM Get the first two letters of the word
ECHO WORDCHAR=%WORDTEMP:~0,2%


Wednesday, February 16, 2011

Excel - Look up values vertically in a list by using an exact match

Excel formula to look up a value in an unsorted range (INDEX function)

e.g. =INDEX(A2:B5,MATCH("Pears",A2:A5,0),2)

  1. A2:B5: The entire range in which you are looking up values.
  2. MATCH("Pears",A2:A5,0): The MATCH function determines the row number.
  3. "Pears": The value to find in the lookup column.
  4. A2:A5: The column for the MATCH function to search.
  5. 2: The column from which to return the value. The leftmost column is 1.

Thursday, January 20, 2011

Windows 7 BSOD at Startup

"STOP: 0x0000006B" Stop error message during startup on a computer that is running Windows 7 or Windows Server 2008 R2
You have a computer that is running Windows 7 or Windows Server 2008 R2. However, the computer crashes during the startup process before you are prompted for user credentials.

Additionally, you receive a Stop error message that resembles the following: STOP: 0x0000006B (Parameter1, Parameter2, Parameter3, Parameter4) PROCESS1_INITIALIZATION_FAILED Note The four parameters in the Stop error message may vary, depending on the configuration of the computer.
This issue occurs because the Bootcat.cache file is corrupted or because the size of the Bootcat.cache file is changed since the last successful start.
Note The Bootcat.cache file is located at %SystemRoot%\system32\codeintegrity
(The %SystemRoot% folder is where Windows is installed. This is usually C:\Windows .)

Workaround for Windows 7 and for Windows Server 2008 R2
To work around this issue, start the computer from the disc drive or from the USB drive by using the Windows installation media. Delete the Bootcat.cache file, and then restart the computer.

http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/18250508-4ef2-4ddd-9599-ee1b11e32a32

Wednesday, December 22, 2010

WSUS Looping Issue

Be careful when declining updates in WSUS.
I came across an issue where a recent "Cumulative Security Update for Internet Explorer 7" update was approved and being installed successfully on the clients. After a reboot, an earlier "Cumulative Security Update for Internet Explorer 7" would also get installed. After another reboot, the first one would be installed again, etc.

The cause of this was because I had declined some updates in between the ones that were looping. i.e. with updates A, B, C, D, I had previously approved update D, then afterwards declined B and C because I wanted to install the more recent A.
The solution is to either decline the oldest approved update (or any update that is looping and is older than the current one), or approve each update in between.
NB: even after the fix, the looping will continue until the client talks to the server again, i.e. at 3am or if you force it.

Wednesday, December 8, 2010

100+ Useful Run Commands For Windows 7, Vista and XP

See the following link for the commands:

http://www.computertipsfree.com/useful-run-commands-for-windows-vista-and-xp/


Some handy commands are:




mstscRemote Desktop (/f = fullscreen, /v:<servernamne>, /admin = console session)
services.mscServices
msconfigSystem Configuration Utility
msinfo32System Information
rsop.mscResultant Set of Policy

How to configure interrupt request (IRQ) priorities in Windows Vista and Windows 7

Most components directly attached to your motherboard—including PCI slots, IDE controllers, serial ports, the keyboard port, and even your motherboard’s CMOS—have individual interrupt requests (IRQs) assigned to them.
An interrupt request line, or IRQ, is a numbered hardware line over which a device can interrupt the normal flow of data to the processor, allowing the device to function.

Windows Vista and 7 lets you prioritize one or more IRQs (which translate to one or more hardware devices), potentially improving the perfoemance of those devices.  See the link below for basic registry editing tips that you can use to set IRQ priorities.
http://helpdeskgeek.com/windows-vista-tips/manage-irq-settings-windows-vista-7/

Monday, November 15, 2010

How to add/remove Registry Items using a REG File

Simply export the required reg keys from the registry into a REG file. Or create one yourself.
Then use the following command line.

REGEDIT [ /S ] addsome.REG

---------------------------------
To remove an entry:

To remove an entire "tree" from the registry using REGEDIT and a .REG file, just add a minus sign before the tree name:

REGEDIT4
[-HKEY_CURRENT_USER\DummyTree]
will remove the entire tree "DummyTree".

To remove an individual item from the registry, place the minus sign after the equal sign:
REGEDIT4
[HKEY_CURRENT_USER\DummyTree]
"ValueToBeRemoved"=-

Wednesday, November 10, 2010

Perform Platform Specific Registry Changes for the Default User

Perform Platform Specific Registry Changes for the Default User

Load the hive, i.e load the default user's ntuser.dat file into the registry, then force the reg changes into the registry, then unload the ntuser.dat file (unload the hive) from the registry.

Reg Load HKU\du "c:\users\default\ntuser.dat"
Regedit.exe /s c:\Drivers\additional_default_user_settings.reg  (the entries in this reg file start with HKU\du)
Reg Unload HKU\du

Thursday, October 21, 2010

How to check group policy on client PC

RSOP.MSC (Resultant Set of Policy).
This allows you to view the group policy (GP) that the client is using.

Thursday, May 13, 2010

Wednesday, January 28, 2009

Annoying Password Popups

Just a bit of sharing... I’m sure it’s useful to someone!

I’ve been getting bugged for a while when accessing some servers that have an old copy of my password saved. I get prompted each time I change my password to re-authenticate.

This applies to Windows Explorer and IE (in XP, not sure about Vista). I’ve know of a few people getting prompted to authenticate onto the MOSS sites.

Solution:
Start > Run > “rundll32.exe keymgr.dll, KRShowKeyMgr” (without the quotes) > OK
This will list all the Network locations and Web Sites that have a authentication details stored. You can view the properties or remove the entry.

Hope this helps.

(Thanks to Mike Halliday for this)

Friday, January 9, 2009

Edit the registry on a mounted WIM

This is an incredibly valuable task. Windows Vista employs "Image Based Setup", meaning their is no more i386 folder. Instead, Windows now comes on the DVD as an image that is copied and expanded during setup. An admin can capture a custom .WIM windows image and mount the WIM to add/modify/remove files. Did you know you can also edit the registry?

Mount the WIM file to a local folder using ImageX.

  • C:\ImageX>imagex /mountrw install.wim 1 c:\mount

    ImageX Tool for WindowsCopyright (C) Microsoft Corp. 1981-2005. All rights reserved.
    Mounting (RW): [C:\ImageX\install.wim, 1] ->[c:\mount]
    Successfully mounted image (RW).

Load the registry hive you need. In this case let's mount HKLM\Software.

  • C:\mount>reg load HKLM\test c:\mount\windows\system32\config\software

    The operation completed successfully.

Open Regedit to make changes to the HKLM\test folder or use Reg Add from the command line.

Don't forget to Unload the reg hive.

  • C:\Windows\system32>reg unload HKLM\test

    The operation completed successfully.

Unmount the image.

  • C:\ImageX>imagex /unmount /commit c:\mount

    ImageX Tool for WindowsCopyright (C) Microsoft Corp. 1981-2005. All rights reserved.
    Unmounting: [c:\mount]...
    Successfully unmounted image.

It really is that simple. Changes to be made without having to apply, sysprep, and recapture the image. You could leverage this as a tool in a variety of ways such as to embed a script to run application installations after the image has been deployed, automate activation using slmgr.vbs, etc.

Thanks to michael.greene for this. See original post here http://blogs.technet.com/migreene/archive/2006/12/07/edit-the-registry-on-a-mounted-wim.aspx

Tuesday, December 30, 2008

How to obtain an uninstall string from the registry for an application listed in add/remove programs

Under “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\” there are a number of product GUIDs listed, eg, {6BB9FB92-93A6-4763-8 D 15-DEB4D5433030}. Look through each of these, looking at the “DisplayName” key, to find the software you want to uninstall. Once found, there will be another key called “UninstallString”, and this has the command required to uninstall the product, eg, MsiExec.exe /I{6BB9FB92-93A6-4763-8 D 15-DEB4D5433030}
NB: the “DisplayName” key is also what is displayed in “Add/Remove Programs”

Edit: Another way to find the required GUID is to open up Component Services.
  1. click on "start > run", type in DCOMCNFG, and press Enter
  2. Expand the trees "Component Services > Computers > My Computer"
  3. Click on the DCOM Config folder
  4. In the right-hand pane find the application you are looking for, the GUID for that app is displayed next to it.

How to change the location of a shortcut (icon) on Wise MSI Editor

  1. Open Wise MSI editor (at LN it's at "\\%dsserver%\eXpress\Wise Packager\WfWI.exe"
  2. Open the required MSI file
  3. Click on “Installation Expert”
  4. Click on “Shortcuts” within “Project Summary”
  5. Double-Click on the shortcut you want to change
  6. In “Dest. Directory”, select the root folder you want the shortcut to be placed in.NB: “Windows\Profiles” = “C:\Documents and Settings\All Users\”
  7. Click “New Folder” and add the rest of the path. Eg, to point the shortcut to “C:\Documents and Settings\All Users\Start Menu\Lion Menu\LNA Applications” the “Dest Directory” should read “Windows\Profiles\Start Menu\Lion Menu\LNA Applications”

NB: if the folder where the shortcuts are meant to be is not available under the 'shortcuts' menu, you can add a folder under the 'Feature Details > Folder' section of Wise.

Deploy MSIs that Have No Advertised Entry Points

MSI packages are great to create or edit when, after you install it, you have a shortcut to click on which will install at "first run" all the required registry settings for the current user (as long as the shortcut is advertised).

But, what happens for the current user when there is no shortcut to click on? e.g. you have an active x control to package, or an Excel add-in. No settings are setup for the new user and, more often than not, the package won't work (except for the user who installed the app).

The way around this problem is to use Active Setup registry keys.

You may have noticed when you first logon to a PC and it creates your new profile that the "Personalized Settings" box appears and sets up your personalized settings. Well, this is the Active Setup Process.

Each time a user logs in, Windows compares the:

  • "HKLM\Software\Microsoft\Active Setup\Installed Components\[PRODUCTCODE]"and
  • "HKCU\Software\Microsoft\Active Setup\Installed Components\[PRODUCTCODE]"registry keys.

If the registry entries from HKCU do not exist or they have an inferior version number than those from HKLM, then the command stored in the "StubPath" entry is executed and the appropriate entries are created in HKCU.

The only thing you need to do is add the appropriate entries in "HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\[ProductCode]".

The most important entry to include is "StubPath". If missing, nothing will be executed.
"StubPath" should have a string value such as "msiexec /fups {ProductCode} /qb".
After the package is deployed, when a user logs in, Windows will check the Active Setup registry entries and will notice that the application is not installed for the current user. In this case it will run the command line that will force the installation of the application for the user and all user files and registry keys will be installed in the appropriate locations. After that, Windows will generate the appropriate Active Setup registry entries for the installed application so the installation process won't be repeated at the next log in of the same user.

Thanks to duijsterj for this information. See the link below for the the original transcript:
http://www.symantec.com/community/article/1555/deploy-msis-that-have-no-advertised-entry-points

Basic Quick DOS batch file script to copy a shortcut to a PC based on the computer location

This will only work in Altiris deployment console because of the %DSSERVER%

@echo off
rem Copy Shortcut to PC based on PC location
SET NZ=LNZALTIRIS01
SET COPY_FROM_LOC=\\%DSSERVER%\eXpress\Library\AUNZ\Archive\Apps\Frontier Software
SET COPY_TO_LOC=C:\Documents and Settings\All Users\Start Menu\Lion Menu\LN Applications
IF %DSSERVER%==%NZ% goto NZ

rem PC is based in Australia
COPY "%COPY_FROM_LOC%\CHRIS21Prod-AUS.lnk" "%COPY_TO_LOC%\chris21.lnk" /Y
goto end

:NZ
rem PC is based in NZ
COPY "%COPY_FROM_LOC%\CHRIS21Prod-NZ.lnk" "%COPY_TO_LOC%\chris21.lnk" /Y
:end
exit %errorlevel%