cancel
Showing results for 
Search instead for 
Did you mean: 
adamabel1
Level 3

How to force Quickbooks to open to "pick a company file"

I am having problems with the webconnector sync staying up and running where Quickbooks will open to a login page of the last company file that was opened and the webconnector sees this as a modal window and can't sync automatically.   Once you login or hit cancel on that window webconnector works.  If you close Quickbooks and open it from the shortcut it will open to the "pick a company file" window and webconnector will be able to run correctly.  My issue is I'm trying to make it consistent that it stays on that company file window.  When I close and reopen Quickbooks with powershell to fix Quickbooks or the webconnector crashing or getting into a stuck state I can't guarantee it will open that window. 

2 Comments 2
BigRedConsulting
Community Champion

How to force Quickbooks to open to "pick a company file"

RE: How to force Quickbooks to open to "pick a company file"

 

Run QuickBooks with the command line parameters: - QFM ""

(space - space QFM space "")

 

For example:

"C:\Program Files (x86)\Intuit\QuickBooks Enterprise Solutions 19.0\QBW32EnterpriseAccountant.exe" - QFM ""

 

If you run QuickBooks from a shortcut, you can edit the shortcut and add the parameters in the Target field.

 

Note this is a version if getting it to launch with a specific company file, but in that case replace "" with the full company file path and file name.

adamabel1
Level 3

How to force Quickbooks to open to "pick a company file"

Thanks that worked as I expected.  

I actually came back here to post another way I found to do this.  

I spent the last day looking at process monitor logs when you login to the company file or load quickbooks and found that QuickBooks is reading C:\Users\username\AppData\Local\Intuit\QuickBooks 2022\qbwuser.ini and looking for a for a line "DATAFILE=your company file."

If it finds it it'll prompt the username and password.  If not you get to pick a company file when you open quickbooks.  

 

So I wrote a powershell script to look for that string in the file and then remove the line.  If anyone else needs it here it is.  

The reason I am doing this is to get around how poorly the webconnector is programmed.  Often times we have to go into Quickbooks and fix data issues with a sync and when my support people are done and close quickbooks the webconnector won't be able to login if that username and password modal window is up.  

 

#parse file QBWUSER.INI to find line containing "datafile=" and remove that line. This will remove the prompt in QB for a username and password.
$QBWuserpath = "C:\Users\$ENV:USERNAME\AppData\Local\intuit"
$QBWUSERINI = "QBWUSER.INI"
$findQBWuserini = Get-ChildItem -Path $QBWuserpath -Recurse -Filter $QBWUSERINI -File -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
$QBWUSERINIContents = Get-Content $findQBWuserini
#delete "datafile=" and all information after it in that line from $findqbwuserini file
$newcontents = $QBWUSERINIContents -replace 'DATAFILE=.*','' | Set-Content $findQBWuserini

 

Additionally if you want to launch quickbooks with that arguement here is a powershell script do find the qbw.exe and launch it.  

 

$targetFileqb = "QBW.exe"
$basePathqb = "C:\Program Files\Intuit"


# Search for the target file recursively
$foundFilesqb = Get-ChildItem -Path $basePathqb -Recurse -Filter $targetFileqb -File -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
# Check if any files were found
if ($foundFilesqb) {
foreach ($fileqb in $foundFilesqb) {
Write-Host "Launching file: $fileqb"
Start-Process -argumentlist '- QFM ""' -FilePath $fileqb
}
}
else {
Write-Host "File '$targetFileqbw' not found in '$basePathqbw'."
}

Sign in for expert help
Ask questions, post replies & join our community of QuickBooks users.

Need to get in touch?

Contact us