null
        New-ItemProperty -Path $newKeyPath -Name "path" -PropertyType String -Value $file.FullName > $null
        New-ItemProperty -Path $newKeyPath -Name "DAY" -PropertyType DWORD -Value $date.Day > $null
        New-ItemProperty -Path $newKeyPath -Name "HOUR" -PropertyType DWORD -Value $date.Hour > $null
        New-ItemProperty -Path $newKeyPath -Name "MINUTE" -PropertyType DWORD -Value $date.Minute > $null
        New-ItemProperty -Path $newKeyPath -Name "SECOND" -PropertyType DWORD -Value $date.Second > $null
        New-ItemProperty -Path $newKeyPath -Name "MONTH" -PropertyType DWORD -Value $date.Month > $null
        New-ItemProperty -Path $newKeyPath -Name "YEAR" -PropertyType DWORD -Value $date.Year > $null
    }
}
#
# Delete the startup programs the user selected and backup to corresponding place.
#
function RemoveStartupPrograms([string[]]$keyArray, [string[]]$linkPathArray, [string]$diagInputName, [bool]$backup=$true)
{

    $choices = New-Object -TypeName System.Collections.ArrayList
    [string]$inboxExeProductName = GetInboxExeProductName
    #
    # Perhaps the string array could be added later.
    #
    $saveValues = ,"WindowsWelcomeCenter"
    foreach($key in $keyArray)
    {
        #
        # Check whether the key is existed in registry
        #
        if(-not (Test-Path($key)))
        {
            Continue
        }
        $keyObj = Get-Item -Path $key
        #
        # Finds out the values from registry that can be removed and let user choise which values should be deleted
        #
        $names =  $keyObj.Property
        foreach($name in $names)
        {
            [bool]$canBeRemoved = $true
            foreach($saveValue in $saveValues)
            {
                if($name -eq $saveValue)
                {
                    $canBeRemoved = $false
                    break
                }
            }
            if($canBeRemoved)
            {
                [string]$data = (Get-ItemProperty -Path $key -Name $name).$name
                [System.Text.RegularExpressions.MatchCollection]$matches = [System.Text.RegularExpressions.Regex]::matches($data, "\""?(?<exePath>.+.exe)\""?", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase)
                #
                # EXception will be throw if the condition is not content.
                #
                [string]$value = "$key $name"
                [string]$name = $name
                [string]$description = $localizationString.tooManyStartupPrograms_companyName_Unknown
                [bool]$needbeAdded = $true
                if($matches.Count -gt 0)
                {
                    try
                    {
                        [string]$exePath = $matches[0].Groups["exePath"].Value
                        $needbeAdded = NeedAddToList $exePath $inboxExeProductName
                        if($needbeAdded)
                        {
                            [string]$targetPath = [System.Environment]::ExpandEnvironmentVariables($exePa# Copyright  2008, Microsoft Corporation. All rights reserved.

#
# Remove all users's startup programs
#

Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData
. .\CL_Utility.ps1

Write-DiagProgress -activity $localizationString.progress_rs_removeAllUsersStartupPrograms

$choices = New-Object -TypeName System.Collections.ArrayList

#
# Perhaps the string array could be added later.
#
[string]$HKLMRun = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
[string]$HKLMWowRun = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run"
$keyArray = ($HKLMRun, $HKLMWowRun)
#
# check startup file
#
[string]$programData = "$env:SystemDrive\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
$pathArray = ($programData)

RemoveStartupPrograms $keyArray $pathArray "IT_AllUsersStartupPrograms" $true

