How to open a small window of microsoft edge by command line - command-line

I want open a small Edge's window(i.e 600px*600px) via command line prompt.
So I tried this command, but didn't open small window.
These options aren't supported now?
start msedge.exe --new-window --window-size=600,600 https://yahoo.com

I found that the command line works if you kill all the Edge process in Task Manager first.
You can try to kill all Edge process in Task Manager or run this command line first: taskkill /F /IM msedge.exe. After that, you can run your command line then the Edge window will be 600*600.

Related

Unwanted second command prompt opens when running mongo.exe via command prompt

I'm running a built meteor app on my local machine, and to quickly boot it up, I have a .bat file that runs the following:
start "C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"
set ROOT_URL=http://localhost
set MONGO_URL=mongodb://localhost:27017/myapp
set PORT=80
node main.js
When I run the cmd to start up mongo.exe it opens up a command prompt with nothing in it, as if I opened it manually.
So now, I really would like to know: why? and how to prevent this.
By default startopens up a new command line window since it assumes your command must be run with cmd.exe. If you do not like to see the window try adding /B to your start command.
See start /? on the command line to check on other options you might find interesting.

Close a CMD window which opened through MATLAB

I am running a program which calls powershell via the system command multiple times. At the end I end up with many opened windows. I would like either these windows to close after each iteration has been completed or run in the background without opening the command window.
pubPath = 'powershell -inputformat none cd C:some path in my pc &';
[status,publisher] = system(pubPath);
I've tried the exit and exit() commands at the end of my paths but nothing has worked so far. Any help would be great.
For future reference, I found a solution to my issue. Execute this command after the loop executes all its instances and all the spawned command windows will be closed. BECAREFUL, you might kill more processes than you want.
system('taskkill /IM cmd.exe')

Cmd.exe no popup

I have to run cmd / c from a program, run the start command xx.exe, and I capture the result (there xx.exe?). until everything is right, however, remains open the console with the error popup. how can I close the console with the error?
Usually win32 applications will close the command prompt after execution. If this isn't the case with what you're trying to run, you could:
Run it from Windows "Run" option (Windows button+R) than your program name and path in prompt.
Run it from a batch file, like so:
runMe.bat:
START "" "C:\windows\notepad.exe"
EXIT`
Than just run runMe.bat from wherever. Notice the 'exit' command that closes the command prompt after execution.
Read more about batch files, the start command, and this issue here, and there.
Good luck!

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

Problem with the start /wait command

#echo off
start /wait notepad
start worpad
This is the code i have written in a batch file. My aim is to stop the batch file execution till the notepad application gets closed. Its working perfect but the thing is, Its displaying the command prompt also .Its opening the command prompt when i execute
start /wait notepad in my batch file.
The command prompt gets closed when i close my notepad. But i dont want the command prompt.How do i make that. I even tried these
cmd /c start /wait notepad
even the above command is not working. How do i make it.How do i open only notepad without the command prompt and wait till it is closed ?
As I said in my answer to one of your previous questions, the command prompt window is there because it is the tool that processes the batch file. The command prompt window is the working window of the CMD.EXE program, just like Notepad's working window is the one where you are editing text files. Typically, running a program with its working window hidden is a non-trivial task, unless the program has a pre-defined mode of running with the hidden window. As it happens, CMD does not have such a mode.
However, there is a way of starting a program with its window minimised. You only need to create a shortcut to your program (it can be a batch file too), then open the shortcut's properties, and on the Shortcut tab, set the Run property to Minimized. To make it clearer, here's an illustration:
Or maybe you can just use the
ping localhost -n ( your time in second ) >nul
So your code will be like this
#echo off
start notepad
ping localhost -n ( your time in second ) >nul
start worpad