How command line tool communicates with browser? - command-line

It is a command line tool force-cli
When use force login, it opens browser and ask for Oauth login. After authorization, the browser closes and go back to command line tool.
I am new to command line tool (Terminal.app or cmd.exe)
My question is how command line tool communicates with browser. i.e. How force login command opens browser and how browser closes and go back to command line.

For opening browser from command line (cmd.exe in Windows or terminal in Linux-systems) you just need to know URL of page that you want to open and use some of appropriate command. For Windows command line it's start URL, for Linux - firefox URL, x-www-browser URL or some distributions have xdg-open URL, for MacOSX it is rumored to be open URL. For more information you can read this article.

Related

Microsoft-Edge's command-line option "--load-extension" does not working

I want to load the temporary extension when you open the browser.
But the command for Microsoft Edge does not work.
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --load-extension="C:\Users\Administrator\Desktop\autoLogin"
The command for Chrome works.
C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe --load-extension="C:\Users\Administrator\Desktop\autoLogin"
What should i do?
I have tested further on my side and found that the below command loads the extension to the Edge browser.
start msedge --load-extension="<Extension-path>"
Output:
Note: Make sure to close all the instances of the Edge browser before running this command.

How do I start Edge from the command line with an argument for URL but open it in a new window?

I'm using start microsoft-edge:https://www.myURL.ca to open an Edge browser from CMD. The problem is that I'd like to open it in a new window.
I found the "--new-window" argument which can be used from a structure passed in via C#, but I'm not able to figure out how to get that argument to Edge from CMD.
You could use the command below will help you launch the MS Edge browser new windows from CMD.
start msedge www.microsoft.com --new-window
Output:
In the test result, you could notice that there is an existing Edge window. when we run the command it opens a new Edge window.

Application Issue, WHOIS database

There is an application to search WHOIS database directly:
https://technet.microsoft.com/en-us/sysinternals/bb897435
When I opened it at first time, I accepted the agreement, but closed it immediately after that. Now, each time I try to open this app, it opens and closes immediately. Same happens on another laptop.
What is the problem?
It is a command line tool. You should use the command prompt (dos prompt) to use it. Open the command prompt by pressing the Windows Key + R, type CMD and press enter.
Then navigate to the folder where you extractd the zip file and type:
whois -v stackoverflow.com
And you get the whois information

Opening a file in a Metro app from command line

I need a way to open a file in a Metro app from command line.
So far I've figured out how to start the app from command line without any third-party scripts
explorer shell:AppsFolder\Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader
but I haven't been able to figure out how to include a file name yet.
Launching
explorer shell:AppsFolder\Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader example.pdf
just opens up a default explorer window.
Any idea from Windows 8 experts on how to accomplish this without any third-party tools/cmdlets/etc.?
Note: In fact I'm using Windows 10 but I guess if there's a Windows 8 / 8.1 way to do it, it'll work for 10, too.
If you're still looking for the answer, the best way to open a file in a metro app is to use an execution string like a normal app protocol does. The execution string looks like this:
bingnews:[arguments, can be left blank.]
microsoftvideo:[arguments, can be left blank.]
netflix:[arguments, can be left blank.]
So, to start up netflix, it's as simple as typing in Start netflix: into the command line.
To find the execution string for an app, go here: Control Panel\Programs\Default Programs\Set Associations
More info and examples can be found here.
http://windowsitpro.com/windows-8/opening-windows-8-apps-command-prompt-or-script
http://www.itsjustwhatever.com/2012/10/28/launch-windows-8-metro-apps-from-a-desktop-shortcut-or-command-line/
PLEASE NOTE: To open an app WITHOUT A PROTOCOL (One not listed in the registry or under "Set Associations") use OP's method:
explorer shell:AppsFolder\[appuid]![appfullname]
The app UID is the folder name without the version number. For example,
4DF9E0F8.Netflix_2.11.0.8_x64__mcm4njqhnhss8
becomes
4DF9E0F8.Netflix_mcm4njqhnhss8
The app fullname is the [App author].[App name] For example, 4DF9E0F8.Netflix. 4DF9E0F8 is the author, and Netflix is the name.
Put it all together to get
explorer shell:AppsFolder\4DF9E0F8.Netflix_mcm4njqhnhss8!4DF9E0F8.Netflix
Store Apps can only be started by the shell. So try this:
explorer.exe shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
Or from run (Win+R):
shell:AppsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
If the app is the default handler then you can just launch the file or protocol. There isn't a good in-box way to launch a file into a non-default handler from the command line.
Windows Store apps aren't designed to run from the command line and there isn't a straightforward way to launch them from the command line. Apps which handle specific files or protocols receive them through FileActivatedEventArgs or ProtocolActivatedEventArgs rather than command line arguments
You could write a launcher app which uses CLSID_ApplicationActivationManager's IApplicationActivationManager to ActivateForFile a specific app.
The best way I've found to pass command-line arguments to the executable targeted by the shell command is via the Windows start command.
Using your example, you would end up with this:
start "" shell:AppsFolder\Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader example.pdf
I don't have Microsoft.Reader installed, so I can't test that. However, I can verify that this pattern works with Windows Terminal. In this case, I pass it a command-line argument to tell it which profile I want to open.
start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "GitBash"
The first argument to the start command here — the empty string — is just the title of the window.
You can also pair this with cmd /c, which I've found is necessary for some launcher applications, such as my personal favorite, SlickRun:
cmd /c start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "GitBash"
I have a blog post with more info on running Modern apps from the command line, which you might find helpful in constructing these ridiculously obtuse commands.
Not sure if it works on Windows 8, but on Windows 10 I use this:
cmd /C start <app-name>:
For example, to start Slack:
cmd /C start slack:

Making bat file in Window Mobile 6

I have Windows mobile 6. I have installed Cre-ME+, and command line. In the command line we need to type the following command and execute it, to load Oracle Mobile Application:
\Windows\CrEme\bin\CrEme.exe -Of -classpath \Windows\CrEme\lib\AWTclasses.zip;\XONTMWA\lib\j4205328.zip oracle.apps.mwa.awt.client.StartGUI
However, Windows Mobile does not support the bat/cmd file execution, so what would be a equivalent way of starting the Oracle Mobile Application, without having to type the command every time?
Create a shortcut with the command line, either via API or with your favorite text editor.
The contents would look like this (if my character count is right anyway):
139#\Windows\CrEme\bin\CrEme.exe -Of -classpath \Windows\CrEme\lib\AWTclasses.zip;\XONTMWA\lib\j4205328.zip oracle.apps.mwa.awt.client.StartGUI