Run .url file
I am trying to open an app using a
.url
shortcut. I tried using the same method as for .lnk
shorcuts but it's not valid.
Anyone knows a workaround?
Code:
7 Replies
.url file is just simple ini file, so only one thing you need to do is read that file and extract url from it
[InternetShortcut]
URL=http://www.someaddress.com/
WorkingDirectory=C:\WINDOWS\
ShowCommand=7
IconIndex=1
IconFile=C:\WINDOWS\SYSTEM\url.dll
Modified=20F06BA06D07BD014D
HotKey=1601
thats how it look when you open it in text editor
There is unofficial documentation http://www.lyberty.com/encyc/articles/tech/dot_url_format_-_an_unofficial_guide.htmlBut how could I run a URL that opens an app?
like with an adress
minecraft:?Editor=true
Oh wait a second
I found something on SO that works 🥳
https://stackoverflow.com/a/53245993/21437709
Stack Overflow
Process.Start to open an URL, getting an Exception?
I'm trying to open an URL following a simple method written all over google and even MSDN. But for unknown reasons I get an Exception as follows:
Win32Exception was unhandled
Message: Application ...
I'm not Windows expert, but there is some method in shell32.dll which allows you to run urls
You can also try this
Quora
What is the equivalent of "xdg-open" on Windows?
Answer (1 of 3): You can use 'start' command. it will open the file with default windows environment.
Suppose you have a file test.txt, which by default opens in notepad++. just enter command start .\test.txt. It will launch notepad++ with this file open.
You can execute commands like "start" with Process.Start
Yeah that's what the comment says, thanks 🙃