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

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.

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.

flutter commands can't run in command prompt on windows 11

any time I input a flutter command in cmd, a new window for the prompt opens and closes quickly and then returns to the old prompt asking me to input a new command without having any effect from the old command. for example...flutter create 'appname' doesn't run but returns asking me to input a command.
i have set my paths and everything too

Ctrl+c not working in integrated terminal which uses Powershell

I'm using Powershell in the integrated terminal by adding the following line to the settings.json file.
"terminal.integrated.shell.windows": "C:\\WINDOWS\\system32\\WindowsPowershell\\v1.0\\powershell.exe",
It works very well, but usually, when I'm in Powershell, typing ctrl+c cancels what I had typed and opens a new line.
But in the integrated terminal it just prints ^C.
Is there a way to fix it or find an alternative method to achieve this?
Thanks
This is with VSCode and not necessarily with the PowerShell Extension. You can see this by just using the default cmd.exe terminal, CTRL+C does nothing. It does not print the ^C at all, and creates no new line.
If you want this to work as expected in the normal command prompt or PowerShell.exe you will need to submit an issue to VSCode repository and request it.
I would expect this is all tied to the keybindings.json file. I went through that file but could not find a command available to the same function that occurs in the full command prompt or console. So this will likely need a new command added for VSCode.
If you search through the keybindings file you can see the terminal has that key CTRL+C bound to copySelection when terminalFocus && terminalTextSelected. This is why the ^C is being output, and no new line is being added.
A workaround:
Pressing Esc will erase the line back to the beginning.

Running a MATLAB script from Notepad++

Is there a way of running a MATLAB script from Notepad++?
Obviously I have MATLAB installed on my computer. I know you can set a path for Notepad++to run when you hit F5, but when I set this path to my MATLAB.exe file, it simply opens another instance of MATLAB.
This is not what I want, I want the actual script in Notepad++ to be executed in the already open and running instance of MATLAB.
I'm afraid I'm not on my home computer at the moment to test this out, so the following is just a suggestion for you to try.
If you take a look at the NppExec plugin for Notepad++, you'll see that with it you can specify a command to be run when you hit F6 (like an enhanced version of hitting F5 in the regular Notepad++). You can also give it variables such as the path to the current file, and the name of the current file.
MATLAB (on Windows at least - I assume you're on Windows) makes available an API over ActiveX/COM. If you search in the MATLAB documentation for details, it's under External Interfaces -> MATLAB COM Automation Server. By running (in MATLAB) the command enableservice('AutomationServer') you will set up your running instance of MATLAB to receive instructions over this API.
You should be able to write a small script (perhaps in VBScript or something similar) that will take as input arguments the path and filename of the current file in Notepad++, and will then connect to a running instance of MATLAB over the COM API and execute the file's contents.
Set this script to be executed in NppExec when you hit F6, and it should then run the current file in the open instance of MATLAB.
As I say, the above is just speculation as I can't test it out right now, but I think it should work. Good luck!
Use NppExec add-on and press F6, copy paste the following and save the script:
NPP_SAVE
set local MATPATH=C:\Program Files\MATLAB\R2015a\bin\matlab.exe
cd "$(CURRENT_DIRECTORY)"
"$(MATPATH)" -nodisplay -nosplash -nodesktop -r "try, run('$(FILE_NAME)'),
catch me, fprintf('%s / %s\n',me.identifier,me.message), end"
then run (press F6; enter). Matlab Console and Plot windows still open and stay open. Error messages will be displayed in opening Matlab command window. Adding
, exit"
to the last command will make it quit and close again. If you want to run an automated application with crontabs or the like, check Matlab external interface reference for automation.
matlab.exe -automation ...
Also works in cmd terminal, but you have to fill in the paths yourself.
This is a usable implementation upon Sam's idea. First, execute MATLAB in automation mode like this.
matlab.exe -automation
Next, compile and execute this following VB in NppExec plugin. (which is to use MATLAB automation API)
'open_matlab.vb
Imports System
Module open_matlab
' connect to a opened matlab session
Sub Main()
Dim h As Object
Dim res As String
Dim matcmd As String
h = GetObject(, "Matlab.Application")
Console.WriteLine("MATLAB & Notepad++")
Console.WriteLine(" ")
'mainLoop
while True
Console.Write(">> ")
matcmd = Console.ReadLine()
' How you exit this app
if matcmd.Equals("!!") then
Exit while
End if
res=h.Execute(matcmd)
Console.WriteLine(res)
End while
End Sub
End Module
Then you'll get a matlab-like terminal below your editor. You can then code above and execute below. type !! to exit the terminal.
What it looks like
Tips: don't use ctrl+c to interrupt the MATLAB command, because it will kill the whole process instead.

Unable to open a second command window from batch file

I have following command to start after other which does not depend on each other. However, with following command, I only can start #1, #2. My command #3 does not start .
I would like to know if i have make any mistake. I did not see the the third line executed.
// make a directory
// startd adb logcat
// shell adb monkey
"test.bat"
mkdir c:\test_log_file
START "powershell Window" powershell adb logcat >> "C:\Testdata.txt"
START "Powershell Window 2" shell adb monkey -p com.android.browser
Based on your earlier question (how to open power shell window from a batch file to a new window), I'm assuming that "shell" is a command you have available to you, and not a typo. Two possibilities come to mind:
Is "shell" in the path? If not, you need to provide the full path to this command. (Probably not the answer, because if this were the issue you'd get a popup error message telling you that Windows can't find "shell".)
Although you've titled the window "Powershell Window 2" in your second START command, this command should actually open a cmd window, not a powershell window. Are you looking for a new powershell window, when you actually have a cmd window that's titled "Powershell Window 2"?
If you want to start a powershell window, the command should be:
START "Powershell Window 2" powershell -noexit shell adb monkey -p com.android.browser