'Batch file to open 3 programs and a folder - I'm almost there

Batch file Requirement; I need to open 1) WindSailor 2) Addons Linker 3) folder (drive) "O" and 4) Excel-01. MSFS.xlsm. The issue is - when Excel opens, it is not set to autosave via OneDrive. I have to set it to autosave manually after it opens.

I have 1 .bat file that opens 1, 2 and 3 perfectly.

@echo off
start "" "C:\Users\Dad\Desktop\WindSailor"
start "" "C:\Users\Dad\Desktop\Addons Linker"
start "" "O:\"

And I have a second .bat file that opens Excel perfectly - all set for autosave via OneDrive.

@echo off
set params=%*
start excel "E:\OneDrive\03. Excel\02. Flight Sim\01. MSFS\01. MSFS.xlsm" /e/%params%

But when I combine the two, Excel opens but not set to autosave...

@echo off
start "" "C:\Users\Dad\Desktop\WindSailor"
start "" "C:\Users\Dad\Desktop\Addons Linker"
start "" "O:\"
set params=%*
start excel "E:\OneDrive\03. Excel\02. Flight Sim\01. MSFS\01. MSFS.xlsm" /e/%params%

I have tried countless variations - what am I missing ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source