.bat file alerts in access (1 Viewer)

John Sh

Member
Local time
Tomorrow, 00:10
Joined
Feb 8, 2021
Messages
410
I am running a .bat file with application.followhyperlink from an access form and getting warning messages.
Application.displayalerts seems to not work in access vba.
Is there an alternative command in access vba or am I missing reference?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:10
Joined
Feb 28, 2001
Messages
27,187
The .BAT file should perhaps contain ECHO OFF? Do a search for "Run .BAT file silently" to see MANY possible solutions, at least one of which might help you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:10
Joined
Oct 29, 2018
Messages
21,473
Try using the shell command instead.
 

John Sh

Member
Local time
Tomorrow, 00:10
Joined
Feb 8, 2021
Messages
410
The .BAT file should perhaps contain ECHO OFF? Do a search for "Run .BAT file silently" to see MANY possible solutions, at least one of which might help you.
Thanks.
I already had Echo off. Tried @echo off, no change.
I'll try the shell option.
 

John Sh

Member
Local time
Tomorrow, 00:10
Joined
Feb 8, 2021
Messages
410
Try using the shell command instead.
The shell is better but still get the message "can't verify who created the file"
Looks like I might have to try and digitally sign the .bat file.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 15:10
Joined
Sep 12, 2006
Messages
15,657
Why do you need the bat file to run the followhyperlink, out of interest?
 

John Sh

Member
Local time
Tomorrow, 00:10
Joined
Feb 8, 2021
Messages
410
Why do you need the bat file to run the followhyperlink, out of interest?
The bat file isn't running the hyperlink, it's the other way round.
In fact I am now using the shell to run the bat file.
I have built an auto-update function that quits the current Access iteration immediately after the bat file starts.
The bat file then does the housework to bring the new file into play.
As for the warning messages, I think I have fixed that by registering the network location as a trusted location.
I haven't tested this yet but indications are this is the fix.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 15:10
Joined
Sep 12, 2006
Messages
15,657
The bat file isn't running the hyperlink, it's the other way round.
In fact I am now using the shell to run the bat file.
I have built an auto-update function that quits the current Access iteration immediately after the bat file starts.
The bat file then does the housework to bring the new file into play.
As for the warning messages, I think I have fixed that by registering the network location as a trusted location.
I haven't tested this yet but indications are this is the fix.
Oh, I misunderstood. Did it not let you continue, when you get the warning, or did it just stop it completely?
 

John Sh

Member
Local time
Tomorrow, 00:10
Joined
Feb 8, 2021
Messages
410
Oh, I misunderstood. Did it not let you continue, when you get the warning, or did it just stop it completely?
The bat file continued to run after the appropriate responses were clicked.
I have tried adding "file://" as a prefix in followhyperlink, running the bat file via the shell and setting the network location as a trusted site.
Some of these methods reduced the warnings to one message but there was always a warning of some sort.
In the end I converted the bat file to an executable file. I still have the cmd window as an indicator that things are happening, but no warnings.
So I am back to followhyperlink and all is good.
 

Users who are viewing this thread

Top Bottom