Access not 'receiving' command line passed to it in batch file (1 Viewer)

RWilliams500

New member
Local time
Today, 11:59
Joined
May 22, 2024
Messages
23
I have a batch file that downloads the current front end from a file server to the user's computer, then runs the front end with ' Start "" "%userprofile%\Documents\Databases\Exam\WarriorExam_USER_FILE.accdr" /cmd batlaunched '. This tells the program it was run from the batch file, rather than someone directly running the front end.

This works without issue on almost all the computers in my company that uses this program. But there is one I tried to install it on today that it will not work. It keeps acting as if it were run without the batch file. Every other computer I am aware of works fine. It's a Windows 10 machine with 2016 32bit runtime installed. I just tried a VM with Windows 10, installed 2016 runtime, and the program ran just fine. So any advice on what the heck might be going on with that one system?
 
Have you tried putting the batlaunched in quotes... "batlaunched" ? And were all other machines where this worked normally Win11 machines?
 
I think you need to prefix the path to your database with the path to msaccess.exe
 
Have you tried putting the batlaunched in quotes... "batlaunched" ? And were all other machines where this worked normally Win11 machines?

Have not tried the quotes. Will do so. It's a mix of Win 10 and Win 11, and I tried it on a Win 10 VM right before posting, and not a problem at all occurred. It is, at the moment, literally one system where multiple others just like it are fine.
 
"Where others just like it are fine." - famous last words, I'm sorry to say. Because computers are predictable. Identical machines will do identical things until you trip over the previously unsuspected difference.

Is this a domain environment where a Domain Controller will download "local policies" to each machine? Do you have multiple working groups where the failing machine is a member of a different group?

Tom's suggestion about prefixing the path information is another possibility in that the machine may have different disk mapping or different policy regarding "default path." Can you put a dummy WORD file next to your .ACCDR file and then from your normal folder as a starting point, use nearly that same command to launch Word? I'm looking for any difference in the default pathways. Your "failing" command is using DOS syntax so you have to think about DOS rules.

OR, if your IT shop even allows this, try visiting any working machine and the failing machine. From the CMD prompt on both machines, issue the echo %path% command and compare what you see. It is possible that one of them is wrong. Or at least different. If you see a difference, then to see which one is right, go to another working machine and repeat that test. Compare all three. IF there is a difference, then Tom's guess was right and it is a default pathing problem.
 
@Isaac - his command line includes a parameter that he uses to tell the thing he is launching that it was launched from a batch environment, not an interactive environment. See the Access command-line option /CMD "text" which passes "text" (probably without the quotes) to the Access Command() function.

@RWilliams500 - Another question comes to mind. Windows comes in various flavors and I don't mean 10/11 or 32-bit/64-bit. There are some differences in the way Win Home interacts with the CMD prompt that might be different for Win Pro. Is that a possible difference for the machine that is failing.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom