1.    10 Mar 2016 #1
    Join Date : Mar 2016
    Medford, OR
    Posts : 3
    Windows 10, 7, XP, & Vista

    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%\base4DOS.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%\base4DOS.exe" /openLF %FCname% %od-user% %FCexit% > nul
    This doesn't work either. Any suggestions?

    Thanks, Phil
      My ComputerSystem Spec
  2.    11 Mar 2016 #2
    Join Date : Jan 2015
    UK, Midlands
    Posts : 10,470
    Win 10 Pro (1703)

    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'.
    Click image for larger version. 

Name:	Snap 2016-03-11 at 13.38.05.jpg 
Views:	5 
Size:	113.1 KB 
ID:	68832
      My ComputerSystem Spec
  3.    11 Mar 2016 #3
    Join Date : Mar 2016
    Medford, OR
    Posts : 3
    Windows 10, 7, XP, & Vista
    Thread Starter

    Quote Originally Posted by dalchina View Post
    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%\base4DOS.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%\base4DOS.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%\base4DOS.exe /openLF %FCname% %od-user% %FCexit% > nul
    EXE runs for a split second, then terminates ... ideas?

    Phil
      My ComputerSystem Spec
  4.    12 Mar 2016 #4
    Join Date : Jan 2015
    UK, Midlands
    Posts : 10,470
    Win 10 Pro (1703)

    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:
    Click image for larger version. 

Name:	Snap 2016-03-12 at 07.34.17.jpg 
Views:	4 
Size:	91.4 KB 
ID:	68981

    Otherwise the second answer here:
    Add application to UAC exceptions

    may point you in the right direction.
      My ComputerSystem Spec
  5.    14 Mar 2016 #5
    Join Date : Mar 2016
    Medford, OR
    Posts : 3
    Windows 10, 7, XP, & Vista
    Thread Starter

    Quote Originally Posted by dalchina View Post
    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
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Can't download batch file
Can't download batch file "10services_default.bat" to solve windows 10 start menu problem.
General Support
Solved Writhing Batch File
Here is my batch file but it will not delete the file? Must be missing something :( del "C:\Users\Larry\AppData\Local\TractorParts\tractor\ConfigSetting" Trying to delete the ConfigSetting File
General Support
Start a program from a batch file
I'm trying to create a batch file that should - call another batch file - start a program and then wait for the program to close - call another batch file My goal with this is to work around an issue in Windows 10 where the screensaver won't...
Software and Apps
Batch file - Unable to start a program minimized
I've been trying to figure this out for a while now and I can't. I've looked at tons of small tips online to get this working but it doesn't work at all. I have a batch file which causes various programs to start when opened. However, one of them...
General Support
System Info Batch File
Hi Everyone, I thought it may be interesting to get input from others regarding this batch file. I was hoping for suggestions about: Information to add to the report. Ways of making the current code more efficient. Etc... A while back i...
Chillout Room
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:09.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums