Pin Application
Pin Application
Taskband"
$regName = "DoNotDelete-Entry"
# Define paths to check
$paths = @(
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
"C:\Program Files\Google\Chrome\Application\chrome.exe",
"C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE",
"C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE",
"C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE",
"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"
)
# Loop through each path and check if it exists
foreach ($path in $paths) {
if (-Not (Test-Path $path)) {
Write-Host "The application path '$path' does not exist. Exiting..."
exit
}
}
Write-Host "All application paths exist. Proceeding with registry check..."
{
Write-Host "The registry path '$Regpath' or value '$regName' does not exist.
Creating them now..."
# Create the registry path if it doesn't exist
if (-not (Test-Path $Regpath)) {
New-Item -Path $Regpath -Force | Out-Null
Write-Host "Registry path '$Regpath' created."
}
# Create the registry value
New-ItemProperty -Path $Regpath -Name $regName -Value "" -PropertyType String -
Force
Write-Host "The registry value '$regName' has been created."
}