1

My computer: Windows 10 running WSL Ubuntu 18.04.

I want to open a windows app file (e.g. an Excel file) from within a WSL bash prompt.

I have made sure that excel.exe is in the $PATH.

But when I type:

excel.exe /mnt/c/Users/bob/Documents/temp/testfile.xlsx

A blank workbook opens, instead of the file I want.

How do I get excel to open the particular file?

I have read this but this returns the error:

Invalid switch - "/mnt".

I also want to make sure that the BASH window opens this file in the background, (not pausing until the Excel application is closed) so that I can continue to use the BASH prompt.

Tim
  • 175

2 Answers2

4

Copied verbatim from https://superuser.com/a/1600972/362088 :

A recent answer for WSL 2: Just do wslview /mnt/c/Users/bob/Documents/temp/testfile.xlsx.

This is a part of the wslu collection and was pre-installed in my Ubuntu.

1

OK, after some help from @Biswapriyo and elsewhere, the answer seems to be:

start excel.exe "C:\path/to/file/in/directory.xlsx"

seems random to me, but there you go!

Tim
  • 175