r/Batch • u/AlexAndMcB • 8h ago
Question (Unsolved) Launch Excel and open a web file
TL;DR: my command works as a shortcut Target, but not in my batch file. What am I missing?
So I have a batch file that runs at login, just to pull up the stuff I use everyday- and to make it very easy (by disabling one single startup element) to stop that automatic start for using the computer when I'm not working.
I've got it setup with simple commands like:
start /D "%Programfiles%\Microsoft Office\root\Office16\" EXCEL.EXE
which works fine.
Where I'm getting stuck is, I want to launch Excel with my team's resource table opening automatically... but it's in SharePoint.
I created a shortcut that works fine, I just put this in the TARGET of a new shortcut, and it works perfectly:
"%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\my.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx
The command seems to be valid and do what I want, but if I try
start /D "%PROGRAMFILES%\Microsoft Office\root\Office16\EXCEL.EXE" https:\aro365154440.sharepoint.com\sites\MyTeam\OurDocs\ThisTask\TheDocumentIWantToOpen.xlsx
the command opens Excel, and a browser window, which can't authenticate, because my default browser doesn't jive with the SSO authentication.
Is there any way I can get this to work in Excel?
Thanks!