0

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.

  • Try to use Windows style paths in cmd /c command. – Biswapriyo Mar 29 '19 at 4:00
  • How did you add excel to the WSL path? I can find EXCEL.EXE in Office's Program Files, and ./EXCEL.EXE works when in that dir, but no matter what I add to my path I can't seem to get just EXCEL.EXE to work – snazzybouche Dec 23 '19 at 5:10
  • Ah, solved that one myself. Created a symbolic link to the exe and dropped it – snazzybouche Dec 23 '19 at 6:12
0

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!

  • What about this: start excel.exe "$(wslpath -w /mnt/c/Users/bob/Documents/temp/testfile.xlsx)" – Carlos Rafael Ramirez Aug 3 '19 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.