Open file in the cloud

Welcome Forums General PowerShell Q&A Open file in the cloud

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 4 months ago.

  • Author
  • #62718

    Topics: 1
    Replies: 0
    Points: 0
    Rank: Member

    I know this is a PowerShell forum but I figured the technical expertise would be found here.

    I need to do the following. Machine abc does not have Office installed locally. A user who is logged into machine abc goes to a network share and double clicks on an Office doc (.xlsx, docx etc....) I need that document to launch in

    Now, I can modify the File Association and point any .xlsx or docx file to run a custom PowerShell Script. This PowerShell script looks like this:

    (if an Excel file was clicked on.......)

    if (Test-Path "C:\Program Files\Microsoft Office 15\root\office15\Excel.exe"){start-sleep -m 1}
    ELSE {cmd.exe /c "C:\Program Files\Internet Explorer\iexplore.exe" ""}

    My issue is this does not open the document that was actually clicked on. How would that be done? So the file could be something like this: \\Server\Share\SubFolder\SubFolder2\Expense Report for January 2017.xlsx

    How would you launch that in Office.Live with Powershell?

  • #62839

    Topics: 13
    Replies: 4872
    Points: 1,812
    Helping HandTeam Member
    Rank: Community Hero

    You're right; this really isn't a PowerShell question. I'm not sure you'd even want to go about it that way. It seems like you'd want some kind of stub handler locally to deal with this, so the file icons and whatnot don't get screwed up. And I'm not even sure what rules Office Online has for opening local documents, versus cloud-stored ones; I know that's a potential security concern of epic proportions, so it might not be easy by design.

The topic ‘Open file in the cloud’ is closed to new replies.