Get 50% OFF QuickBooks for 3 months*

Buy now
cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 
Announcements
Work smarter and get more done with advanced tools that save you time. Discover QuickBooks Online Advanced.

Reply to message

View discussion in a popup

Replying to:
JBrow
Level 2

Reply to message

As others have said in this thread, changing the first "BackgroundEnabled=1" line in the QBUpdate.dat file to "BackgroundEnabled=0" does seem to disable Automatic Updates. The update overview screen says "Automatic Update is OFF" after making this change, but in the Options, it's still greyed out and appears as if "Yes" is selected.

 

I've written a script to do this for me on all systems where I've installed this, and wanted to share it.
You'll need:
- Python3 installed
- A text file named "computerlist.txt" in the same file as the python script with each computer name on a separate line

- To run the script with an account that has the necessary permissions (e.g., Domain Admin) on all computers on the list

 

It will also write a log file, so you know what it did or didn't do on each system.

Note that this is written for the 2023 version of QB Enterprise. If you're running a different version, you'll have to update the datfile_location in line 14.

 

From other things I've seen here, it looks like it's possible that things can trigger the system to turn Automatic Updates back on, so my plan is to run this as a scheduled task a few times a day.

 

IMPORTANT:

This forum won't allow me to upload a python file, nor will it let me just change the extension because it validates the file type, so here's the code:

Note that python is a whitespace sensitive language, so the formatting is important. My test of copying and pasting the text below seems to be formatted correctly when pasting.

 

import datetime
import shutil

nowstamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
logfile = open(".\\logs\\qb_noautofix_log_" + nowstamp + ".txt", "w")
computerlist = open("computerlist.txt", "r")
for computer in computerlist:
    log_msg = ""
    computer = computer.strip()
    print(computer)
    try:
        nowstamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
        print(nowstamp)
        datfile_location = f"\\\\{computer}\\c$\\ProgramData\\Intuit\\QuickBooks Enterprise Solutions 23.0\\Components\\QBUpdate\\"
        datfile_name = "Qbchan"
        datfile_extension = ".dat"
        datfile = open(datfile_location + datfile_name + datfile_extension, "r+")
    except:
        log_msg = "Could not open dat file"
        break
    line_counter = 0
    data = datfile.readlines()
    last_line = len(data)
    while line_counter < last_line:
        line = data[line_counter]
        if "BackgroundEnabled" in line:
            split_line = line.split("=")
            value = split_line[1].strip()
            if value == "1":
                try:
                    shutil.copy(datfile_location + datfile_name + datfile_extension, datfile_location + datfile_name + nowstamp + datfile_extension)
                except:
                    log_msg = "Could not create backup copy"
                    break
                data[line_counter] = "BackgroundEnabled=0\n"
                try:
                    datfile.seek(0)
                    datfile.writelines(data)
                    log_msg = "File updated successfully"
                    break
                except:
                    log_msg = "Could not update file"
                    break
            elif value == "0":
                log_msg = "No change needed"
                break
        line_counter += 1
    datfile.close()
    tab_padding = "\t"
    if len(computer) < 8:
        tab_padding += "\t"
    log_write = f"{computer}{tab_padding}{nowstamp}\t{log_msg}\n"
    logfile.writelines(log_write)
computerlist.close()
logfile.close()

Need to get in touch?

Contact us