Calling this from Module creates Windows Security to block it from running (1 Viewer)

Number11

Member
Local time
Today, 09:14
Joined
Jan 29, 2020
Messages
607
' runs the batch file
shell Test.cmd

This is now causing the operation to fail and windows security is blocking it from running.

is there another way to run a bat file from VBS/modules

1650367223125.png
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:14
Joined
May 7, 2009
Messages
19,169
what does test.cmd do?
show the code.

maybe it can be converted to FilesystemObject methods.
 

Number11

Member
Local time
Today, 09:14
Joined
Jan 29, 2020
Messages
607
what does test.cmd do?
show the code.

maybe it can be converted to FilesystemObject methods.
it copies the same database and replaces the current one, so has to be done via cmd. seems anything that is called using "SHELL" is now being blocked by windows security
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:14
Joined
May 7, 2009
Messages
19,169
can yo use VBA.FileCopy?


/// be warned that you cannot Replace the running db (the one that has this code)
 

Number11

Member
Local time
Today, 09:14
Joined
Jan 29, 2020
Messages
607
can yo use VBA.FileCopy?


/// be warned that you cannot Replace the running db (the one that has this code)
Yeah thats why i have to use the bat file to do that, any other way to call a bat file to run other than SHELL?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:14
Joined
May 7, 2009
Messages
19,169
like i said, you Can't replace the running db with another
unless you close it first, run another db to do the copying.
when done copying, re-open the db.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:14
Joined
Feb 28, 2001
Messages
26,996
Don't know if you can manage this, but consider using the Shell command on a file in a trusted location.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:14
Joined
Feb 19, 2002
Messages
42,970
Yeah thats why i have to use the bat file to do that, any other way to call a bat file to run other than SHELL?
Have you tried FollowHyperlink? I don't know if it works for .exe or .bat files.
 

Users who are viewing this thread

Top Bottom