TJames95
Level 2

Other questions

#CLICKING THE "OPTIONS" TAB UNDER UPDATE QUICKBOOKS DESKTOP TOGGLES VALUE BACK TO OFF
#UPDATES CAN BE DONE MANUALLY JUST DO NOT CLICK OPTION TAB
#BEST TO HAVE THIS RUN AS SCHEDULED TASK
#SAVE THE PS1 FILE SOMEWHERE (LOCALLY) HAVE TASK SCHEDULER EXECUTE THE SCRIPT X AMOUNT OF TIMES PER WHATEVER

Set-ExecutionPolicy Bypass -Force

#Feel free to add the Quickbooks Edition paths you want

#Standard folder paths where pending Premier Accountant Edition Updates are stored.
$QBP18 = "C:\ProgramData\Intuit\QuickBooks 2018\Components\DownloadQB28\*"
$QBP19 = "C:\ProgramData\Intuit\QuickBooks 2019\Components\DownloadQB29\*"
$QBP20 = "C:\ProgramData\Intuit\QuickBooks 2020\Components\DownloadQB30\*"
$QBP21 = "C:\ProgramData\Intuit\QuickBooks 2021\Components\DownloadQB31\*"
$QBP22 = "C:\ProgramData\Intuit\QuickBooks 2022\Components\DownloadQB32\*"
$QBP23 = "C:\ProgramData\Intuit\QuickBooks 2023\Components\DownloadQB33\*"


#Standard folder paths where pending Enterprise Edition Updates are stored.
$QBE18 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 18.0\Components\DownloadQB28\*"
$QBE19 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 19.0\Components\DownloadQB29\*"
$QBE20 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 20.0\Components\DownloadQB30\*"
$QBE21 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 21.0\Components\DownloadQB31\*"
$QBE22 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 22.0\Components\DownloadQB32\*"
$QBE23 = "C:\ProgramData\Intuit\QuickBooks Enterprise Solutions 23.0\Components\DownloadQB33\*"


#Update channel file for Premier versions
$datQBP18 = "C:\ProgramData\Intuit\QuickBooks 2018\Components\QBUpdate\Qbchan.dat"
$datQBP19 = "C:\ProgramData\Intuit\QuickBooks 2019\Components\QBUpdate\Qbchan.dat"
$datQBP20 = "C:\ProgramData\Intuit\QuickBooks 2020\Components\QBUpdate\Qbchan.dat"
$datQBP21 = "C:\ProgramData\Intuit\QuickBooks 2021\Components\QBUpdate\Qbchan.dat"
$datQBP22 = "C:\ProgramData\Intuit\QuickBooks 2022\Components\QBUpdate\Qbchan.dat"
$datQBP23 = "C:\ProgramData\Intuit\QuickBooks 2023\Components\QBUpdate\Qbchan.dat"


# Variables for "For Loops"
$QBFolderUpdates = $QBP22, $QBP21, $QBP18, $QBP19, $QBP20, $QBE21, $QBE18, $QBE19, $QBE20, $QBE22 , $QBE23
$QBDatFiles = $datQBP18, $datQBP19, $datQBP20, $datQBP21, $datQBP22 , $datQBP23

#Clears the Components\DownloadQBXX within %PROGRAMDATA% folder for selected Intuit products
    foreach ($i in $QBFolderUpdates)
        {
            if ((Test-path $i) -eq $true)
            {
            
#Removes folder contents by force
             Remove-Item -Path $i -Recurse -Force
 
            
            }
        }

#Kills QB update service
taskkill /f /im qbupdate.exe

#Modifies Line 4 of QBchan file that toggles updates on and off.
#On line 4 toggling the value BackgroundEnabled=0 turns them off.
#1 = ON, 0 = OFF

#DONOT MODIFY SPACING
foreach ($r in $QBDatFiles) {

((Get-Content -path $r -Raw) -replace 'NotifyClass=QIHndlr.Handler
BackgroundEnabled=1',
'NotifyClass=QIHndlr.Handler
BackgroundEnabled=0') | Set-Content -Path $r

}