Location:
State:
Carrier
Country
Status

Start a program from a batch file


4 Apps of mine run a batch file that -tries- to call/start and EXE program. These Batch files need to work with OS XP thru Win 10. Win 10 has a pop-up window asking user if its okay to run/execute my EXE. No other Win version does this and thus I suspect a timing problem.

Here is a few lines from my BAT file:
Code:
if %WinVer%-5.0 LSS 0.0 (pause) else (timeout /t 8) call %od-tools%ase4DOS.exe /openLF %FCname% %od-user% %FCexit% > nul @echo off
I have tried the following but will this work on older OS versions?
Code:
start /wait "" "%od-tools%ase4DOS.exe" /openLF %FCname% %od-user% %FCexit% > nul
This doesn't work either. Any suggestions?

Thanks, Phil

Can you please post a screenshot of the popup message?

I'm guessing it might be a 'smartscreen' message as you don't specify it. I get this popping up sometimes when installing less common programs I've just downloaded. It's more widely described as an internet site filter.

But quite why that would be the popup you encounter in this case isn't obvious.

Assuming my guess is correct, the following should help you decide what to do. You scan also research 'smartscreen'.

Can you please post a screenshot of the popup message?
Its titled 'User Account Control' and is a pop-up box that may be causing my problem.

I've done a lot of testing between my Win 7 and Win 10 laptop. Here is some code with comments ...
Code:
rem 1. .bat works in All Win.s except Win 10!!rem call %od-tools%ase4DOS.bat/openLF %FCname% %od-user% %FCexit% > nul rem 2. .bat works in All Win.s except Win 10!! rem works! start /wait /B "%FCapp%'s DOSbox Setup" %od-tools%ase4DOS.bat/openLF %FCname% %od-user% %FCexit% > nul rem 3. .exe starts for a split second and then exits in Win 10... a Nogo! rem   It has a 'User Account Control' pop-up box that may cause a timing problem. rem   It works in Win 7.  start /wait /B "%FCapp%'s DOSbox Setup" %od-tools%ase4DOS.exe/openLF %FCname% %od-user% %FCexit% > nul
EXE runs for a split second, then terminates ... ideas?

Phil

Hi, UAC was introduced in Vista, then its impact somewhat reduced. It's meant to give the user a last ditch option to block malicious programs.

You can turn it off altogether:


Otherwise the second answer here:
Add application to UAC exceptions

may point you in the right direction.

Otherwise the second answer here:
Add application to UAC exceptions
may point you in the right direction.
That helped ... I use Inno Setup to install my packages. Under [setup] 'PrivilegesRequired=admin' was changed to 'PrivilegesRequired=none' and that did the trick.

Their was another issue with the Start cmd. I was using 'start /wait /b' and that is a bug. 'start /b /wait' fixed problems.

Thanks for your help, Phil

Start a program from a batch file