Windows 10: Start a program from a batch file

Discus and support Start a program from a batch file in Windows 10 Software and Apps to solve the problem; 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... Discussion in 'Windows 10 Software and Apps' started by OptimalDesigns, Mar 9, 2016.

  1. 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[/quote] 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[/quote] This doesn't work either. Any suggestions?

    Thanks, Phil

    :)
     
    OptimalDesigns, Mar 9, 2016
    #1

  2. Start-up batch file

    I have a batch file that runs upon start-up. It has worked FINE from Win3 onwards, modified as necessary for each version of Windows. However, now I've got WinX, it doesn't work as it used to.

    Specifically, this line works just FINE:-

    Start "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" "C:\Data\My WORD Documents\My File.docx"

    ... but NONE of these commands below does what I want it to, i.e. to load Excel and open a file, then get on with the Batch File:-

    1.

    "C:\Data\Excel\My File.xlsm"

    2.

    Start "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Excel 2010.exe" "C:\Data\Excel\My File.xlsm"

    3.

    Start "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Excel 2010.exe"

    4,

    Start "C:\Program Files (x86)\Microsoft Office\Office14\Excel.exe" "C:\Data\Excel\My File.xlsm"

    5.

    "C:\Program Files (x86)\Microsoft Office\Office14\Excel.exe"

    No. 5 works, but a) it (obviously) doesn't load the file I want, and b) the Batch File then hangs.

    Help !
     
    Robin Clay, Mar 9, 2016
    #2
  3. kjl1956 Win User
    Check disk on a 1 bad sector but drive is 88% healthy, sshd 2 b mbr

    The results are as follows;

    U:\>

    U:\>Stage 1: Examining basic file system structure ...

    'Stage' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 1048064 file records processed.

    '1048064' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>File verification completed.

    'File' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 8622 large file records processed.

    '8622' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 0 bad file records processed.

    '0' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>Stage 2: Examining file name linkage ...

    'Stage' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 17170 reparse records processed.

    '17170' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 1155756 index entries processed.

    '1155756' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>Index verification completed.

    'Index' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 0 unindexed files scanned.

    '0' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 0 unindexed files recovered to lost and found.

    '0' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 17170 reparse records processed.

    '17170' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>Stage 3: Examining security descriptors ...

    'Stage' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>Security descriptor verification completed.

    'Security' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 53847 data files processed.

    '53847' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>CHKDSK is verifying Usn Journal...

    Invalid parameter - verifying

    U:\> 35872856 USN bytes processed.

    '35872856' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>Usn Journal verification completed.

    'Usn' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>Stage 4: Looking for bad clusters in user file data ...

    'Stage' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 1048048 files processed.

    '1048048' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>File data verification completed.

    'File' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>Stage 5: Looking for bad, free clusters ...

    'Stage' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 297247241 free clusters processed.

    '297247241' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>Free space verification is complete.

    'Free' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>Adding 1 bad clusters to the Bad Clusters File.

    'Adding' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>Windows has made corrections to the file system.

    'Windows' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>No further action is required.

    'No' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>1950916280 KB total disk space.

    '1950916280' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 760452004 KB in 448531 files.

    '760452004' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 263136 KB in 53848 indexes.

    '263136' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 4 KB in bad sectors.

    '4' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 1212176 KB in use by the system.

    '1212176' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 65536 KB occupied by the log file.

    '65536' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>1188988960 KB available on disk.

    '1188988960' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\> 4096 bytes in each allocation unit.

    '4096' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 487729070 total allocation units on disk.

    '487729070' is not recognized as an internal or external command,

    operable program or batch file.

    U:\> 297247240 allocation units available on disk.

    '297247240' is not recognized as an internal or external command,

    operable program or batch file.

    U:\>

    U:\>C:\WINDOWS\system32>
     
    kjl1956, Mar 9, 2016
    #3
  4. dalchina New Member

    Start a program from a batch file

    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'.

    Start a program from a batch file [​IMG]
     
    dalchina, Mar 10, 2016
    #4
  5. 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[/quote] EXE runs for a split second, then terminates ... ideas?

    Phil
     
    OptimalDesigns, Mar 11, 2016
    #5
  6. dalchina New Member
    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:

    Start a program from a batch file [​IMG]


    Otherwise the second answer here:
    Add application to UAC exceptions

    may point you in the right direction.
     
    dalchina, Mar 11, 2016
    #6
  7. 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
     
    OptimalDesigns, Apr 5, 2018
    #7
Thema:

Start a program from a batch file

Loading...
  1. Start a program from a batch file - Similar Threads - Start program batch

  2. Starting batch file only opens command prompt versus running the batch file?

    in Windows 10 Software and Apps
    Starting batch file only opens command prompt versus running the batch file?: I'm trying to run one batch file, then another. Instead of running the 2nd batch file, it just opens another black screened command prompt with the name of the batch file as the first line in the command prompt? Any ideas why?...
  3. Starting two programs from a single batch file is different than starting two programs in...

    in Windows 10 Ask Insider
    Starting two programs from a single batch file is different than starting two programs in...: First Concrete example: I run “Start Resident Evil 2” from a batch file I run “Start Resident Evil 2 Trainer” from another batch file Everything works! Okie dokie... So let’s simplify it a bit... I run “Start Resident Evil 2” and “Start Resident Evil 2 Trainer” from the...
  4. Restart a specific program with a batch file

    in Windows 10 Ask Insider
    Restart a specific program with a batch file: I have to restart Windows Audio Device graph multiple times a day to the point that I just want to map a button on my stream deck to end the task. Is there a way to create a shortcut to end the task? I've tried taskkill /f /im audiodg.exe but that was unsuccessful. Any ideas?...
  5. Batch Scripts / Programs.

    in Windows 10 Performance & Maintenance
    Batch Scripts / Programs.: The members and quests who use this forum know how professional, informative and helpful it is! In order to help members solve their problems/issues we often ask them to run certain programs and perform certain tasks and then upload [ post ] the results to the forum for us...
  6. Batch File in start up

    in Windows 10 Network and Sharing
    Batch File in start up: I have created a batch file for cleaning up all temporary and unnecessary file which can be run any time. I want to add this file with the startup of windows 10, so that when ever I start the windows, the file will automatically run and clean up my PC. In windows 7, you can...
  7. Start a program from a batch file

    in Windows 10 Software and Apps
    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 work when I have my game...
  8. Looking for a program to batch resize .png files.

    in Windows 10 Software and Apps
    Looking for a program to batch resize .png files.: I use Photoshop for .jpg files, but it can't seem to do .png. What programs can do this? 57086
  9. Batch file start program minimized

    in Windows 10 Support
    Batch file start program minimized: Here's a little script to make a backup of 2 directories: Code: ::can't copy Opera data while Opera is running taskkill /im opera.exe robocopy c:\all e:\Bobback\All /mir robocopy c:\Users\Bob\AppData\Roaming e:\Bobback\Roaming /mir ::restart Opera minimized start...
  10. Batch file - Unable to start a program minimized

    in Windows 10 Support
    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 always appears above the rest...