none
Timing Batch File Execution

    Question

  • When I first started using batch files, we didn't have a lot of things like long file names, requiring quotes. We also didn't have a choice between running things consecutively or all at once.

    Recently, say 2005 or so, (my age is showing) some of these things changed. I could run a batch file to test different levels of communication which would all run at once, testing local network, internet, and VPN connections to a different company all at the same time, in different windows. However, it was difficult to run things that required completion of one process before another began.

    Is there a way to control whether all things run at once, or if things run consecutively, one step finishing before the next begins?

    While I am asking things, since some of my files come from Europe and use unusual characters, is there a way to get them to be found by my batch files as they process?

    Monday, November 5, 2018 3:22 PM

All replies

  • Your "question" is far too vague and non-specific. (Remember that nobody can see your screen.)

    Please read the following posts. They will help you to ask a good, specific, targeted question.


    -- Bill Stewart [Bill_Stewart]

    Monday, November 5, 2018 6:10 PM
    Moderator
  • I had a project to do that required that data from the customer come in as XLS files. I wanted to process things in Access, output results in the form of Spreadsheets, do any processing that needed to be done where record sequence was important, scoop that up again in Access for proper stigmatization, and then output to Excel and format it for presentation. The batch file I would want to use would need to complete each step before it started the next. I tried it. It worked. Exhibit below. I am just not sure what it would do if I used pings and browser sessions to gather information on communications for diagnostics at this point, but the important thing is it does what I need.

    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Kopie - Fronta práce.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\prodrec.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Prod Rec Consec.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Prod_Rec_Run Prep.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Order Prod Ord.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Order Sched Ord.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Order Sched Prod Comp Hist View.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Order Sched Prod Pct Hist.xlsx"
    DEL "C:\Users\bettrir\Documents\Schedule Conformance\Order Sched Prod Plant Pct Hist.xlsx"
    PAUSE Delete the "Kopie - Fronta práce.xlsx" file manually. The strange letter keeps the batch from removing it.
    PAUSE Copy the current "Kopie - Fronta práce 99-99-99.xlsx" file ([Ctrl]-[C], [Ctrl]-[V]). Rename it to "Kopie - Fronta práce.xlsx"
    PAUSE Copy the current "prodrec 99-99-99.xlsx" file ([Ctrl]-[C], [Ctrl]-[V]). Rename it to "prodrec.xlsx"
    PAUSE Place the date of the current "Kopie - Fronta práce.xlsx" file into the table in the Access database. Close the database.
    "C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Schedule Conformance.accdb" /x "Process Report 0"
    "C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Schedule Conformance.accdb" /x "Process Report 1"
    "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Linked Excel Update 1.xlsm"
    "C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Schedule Conformance.accdb" /x "Process Report 2"
    "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Linked Excel Update 2.xlsm"
    "C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Schedule Conformance.accdb" /x "Process Report 3"
    "C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Linked Excel Update 3.xlsm"
    "C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE" "C:\Users\bettrir\Documents\Schedule Conformance\Schedule Conformance.accdb" /x "Process Report 4"

    Thursday, November 8, 2018 12:40 PM
  • You can do all of that in your Access file.  Why use a batch.  It just makes things harder and more fragile.


    \_(ツ)_/

    Thursday, November 8, 2018 12:51 PM