Task scheduler runs a batch file which launches a powershell script to change the registry. The task is set to run every time someone logs in. The user gets prompted to click yes or no to change registry settings. Of course I want them to press the "yes" button but cannot guarantee they will. Is there a way to suppress the registry change prompt and automatically 'Click' yes every time it asks?
Here is a copy of my .ps1 file:
$regpath = "HKCU:\Software\Laserfiche\Client8\Profile\IPDatabase"
$repositoryname = "Clay"
If ((Get-ItemProperty $regpath).PSObject.Properties.Name -eq $null) {
C:\LF_setup.reg
}ElseIf((Get-ItemProperty $regpath).PSObject.Properties.Name -ne $null){
$RepositoryBoolean = (Get-ItemProperty $regpath).PSObject.Properties.Name -contains $repositoryname
If ($RepositoryBoolean -eq "True"){
Write-Host "Laserfische Setup Correctly"
}}