HTML Excel Link Can't Find File? - html

I'm using this string before a pathway to a local excel document:
ms-excel:ofe|u|
The filepath looks like something like this "Y:/My Files/Organization/This Folder/
When clicking on the rendered link, Excel launches but I get the "Sorry, can't find file" alert which displays the failed path, wherein each space and back-slash are replaced with %20
Am I using that aforementioned ms-excel string correctly?
Thanks!

ms-excel:ofe|u|file:///${batchPath}
The missing bit was file:/// along that string. With that, the locally saved filepaths launched without issue!

Related

open HTML from PowerShell with URL parameters

I am trying to open a HTML file in Microsoft Edge browser from PowerShell.
Below code opens HTML in Microsoft edge
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html')
How to pass some values from PowerShell to HTML using URL parameters.
I wanted something like below code
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html?testvalue1=45&testvalue2=50')
But the above code opens browser but cannot able to load test.html. Using JavaScript I want to get values from URL which is passed by PowerShell.
You could try the command below.
Start-Process microsoft-edge:"https://localhost?testvalue1=45&testvalue2=50"
Output:
One way to accomplish this is to use the "Start-Process" cmdlet
Start-Process 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe' C:\Web\index.html
This however only works if you know the path. For some reason Powershell fails to translate for example .\index.html to a proper path.

How to open a database file with no file type in SSMS?

I have a database file with no file type, I need to open it in SSMS first. When I try to open it, it says no editor for it. I tried to open it in a text editor by changing its name with a txt extension, it displayed unreadable code on the whole page. I have searched online it seems the only way is to change the file name with an extension. Is there any way to make SSMS recognize the generic extension file? Thanks
Larnu corrected me to use "Restore" instead of "Open". Thanks
New to database, need to learn everything.

Error when using non ASCII characters in MS Office URI Schemes

I want to open a file using ms-excel. I read the method at URI Schemes Documentation. I am using the following code.
<a href='ms-excel:ofe|u|file:C:/Users/*********/Downloads/testätür.xlsx'>link</a>
This works fine if my filepath contains only english characters, however it gives error when using non English characters like ö,ä,ß. The link works fine without the 'ms-excel:ofe|u|' and downloads the file but it doesn't work with it. So I can only assume the problem is here.
file:C:/Users/***********/Downloads/testätür.xlsx
If I try to open the file link above, the following error occurs
Can someone help me understand the issue here?
You need to encode the file path properly before using a hyperlink in the document. See What is the proper way to URL encode Unicode characters? for more information on that.

How can I parse a link within locally stored html using python?

I am trying to extract text from a link within an html file that is locally stored. The link is as follows:
file:///Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html#body.202003310521728.1
I can't seem to use open() to access this link. I tried the following but does not work.
open(file:///Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html#body.202003310521728.1)
How can I access this link?
I added screenshots of jupyter notebook for more elaboration
You have to pass the actual file path to the function
Should be something like:
open("C:/Users/Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html")

MediaWiki filepath Magic Word doesn't work for some files types

I'm trying to use the MediaWiki filepath magic word` so that I can create some template links that pass a specific MediaWiki file. Unfortunately with certain file types, filepath just returns nothing.
The file I'm trying to get the path for that's failing is a text file in this case. I have confirmed that I am using the correct filename as I can create a regular file link using [[File:Name.txt]], and {{filepath:Image.png}} works properly.
Example of what I'm trying to accomplish:
[http://server/processfile.php?path={{filepath:<filename>}} Process A File]
Is this a known issue? Is there an easy way that I can debug what's happening here?
After digging around a bunch more I was able to resolve the issue. It turns out that even though the MediaWiki would accept the file, it was being assigned a random mime type because it was a .yaml file.
After updating mime.types and mime.info in MediaWiki and adding the mime type (text/yaml) to my IIS configuration, I was able to get the downloads working and the file links showing up.
Full disclosure: I may have been using an incorrectly cased file name even though I said that I was using the correct file name. :P