Name" = "$name"; "Description" = "$description"; "Value" = "$value"}
                }
            }
        }
    }

    #
    # check startup file
    #
    $startupFileArray = New-Object -TypeName System.Collections.ArrayList
    foreach($path in $linkPathArray)
    {
        if(Test-Path($path))
        {
            $fileArray = Get-ChildItem -Path $path
            if($fileArray -ne $null)
            {
                $startupFileArray += $fileArray
            }
        }
    }

    if($startupFileArray.Count -gt 0)
    {
        foreach($statupFile in $startupFileArray)
        {
            [string]$name = $statupFile.BaseName
            [string]$description = $localizationString.tooManyStartupPrograms_companyName_Unknown
            [bool]$needbeAdded = $true
            try
            {
                $shell =  New-Object -ComObject WScript.Shell
                $shortcut = $shell.CreateShortcut($statupFile.FullName)
                if($shortcut -ne $null)
                {
                    $needbeAdded = NeedAddToList $shortcut.TargetPath $inboxExeProductName
                    if($needbeAdded)
                    {
                        [string]$targetPath = [System.Environment]::ExpandEnvironmentVariables($shortcut.TargetPath)
                        [System.Diagnostics.FileVersionInfo]$fileVersionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($targetPath)
                        [string]$showName = GetStartupApplicationShowName $fileVersionInfo
                        if(-not [string]::IsNullOrEmpty($showName))
                        {
                            $name = $showName
                        }
                        if(-not [string]::IsNullOrEmpty($fileVersionInfo.CompanyName))
                        {
                            $description = $fileVersionInfo.CompanyName
                        }
                        $description += " " + $shortcut.TargetPath + " " +$shortcut.Arguments
                }
                }
                else
                {
                    $description += " " + $statupFile.FullName
                }
            }
            catch
            {
                $description += " " + $statupFile.FullName
                WriteFunctionExceptionReport "RemoveStartupPrograms" $_
            }
            if($needbeAdded)
            {
                $choices += @{"Name" = $name; "Description" = $description; "Value" = $statupFile.FullName}
            }
        }
    }

    if($choices.Count -gt 0)
    {
        #
        # Deletes the values that the user choices
        #
        $values = Get-DiagInput -id $diagInputName -choice $choices
        if($values -eq $null)
        {
            return
        }
        #
        # delete and backup the registry keys that the user selected
        #
        $nameArray = New-Object System.Collections.ArrayList
        foreach($key in $keyArray)
        {
            #
            # Check whether# Copyright  2008, Microsoft Corporation. All rights reserved.


#
# Remove current user's startup programs
#

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

Write-DiagProgress -activity $localizationString.progress_rs_removeCurrentUserStartupPrograms

$choices = New-Object -TypeName System.Collections.ArrayList
#
# Check registry key
#
[string]$HKCURun = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
[string]$HKCUWowRun = "HKCU:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run"
$keyArray = ($HKCURun, $HKCUWowRun)
#
# check startup file
#
[string]$currentUserRoaming = "$env:userProfile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
[string]$currentUserLocal = "$env:userProfile\AppData\Local\Microsoft\Windows\Start Menu\Programs\Startup"
$pathArray = ($currentUserRoaming, $currentUserLocal)

RemoveStartupPrograms $keyArray $pathArray "IT_CurrentUserStartupPrograms" $false
