How to arrange on a grid conemu new consoles - conemu

I've read the docs about conemu regarding the switch -new_console but I find the syntax pretty confusing and I'm not sure how to create the exact grid layouts I want to.
Here's what I've got so far, consider this script run.cmd:
cmd /c server_0.cmd -new_console:sV
cmd /c microservice_0.cmd -new_console:sV
cmd /c microservice_1.cmd -new_console:sV
cmd /c microservice_2.cmd -new_console:sV
cmd /c docker_1.cmd -new_console:sV
cmd /c docker_2.cmd -new_console:sV
When i run run.cmd with conemu the grid layout will look like this (6x1):
--------------
invoker
--------------
server_0
--------------
microservice_0
--------------
microservice_1
--------------
microservice_2
--------------
docker_1
--------------
docker_2
--------------
How can i tweak run.cmd in a way that will create a new conemu terminal with below arrangement?
--------------------------------------------
server_0
--------------------------------------------
microservice_0|microservice_1|microservice_2
--------------------------------------------
docker_1 | docker_2
--------------------------------------------
Is it possible? If it wasn't possible the above, maybe something like a 3x2 grid would be also nice:
--------------------------------
server_0 | microservice_0
--------------------------------
microservice_1 | microservice_2
--------------------------------
docker_1 | docker_2
--------------------------------
In any case, reason why I'm asking this is because I'd like to have this arrangement fullscreen on 2nd screen so I'll be able to see the logs at once. Also, the reason why I want all of them in a new conemu terminal is because that way I can close all of them at once and spawn them again if i need to.
Last but not least, if there is a better way (that uses conemu best practices), please share... i was thinking maybe this should become a task instead having living in a script (where i need to cd to that directory, spawn it manually, etc...)
Thanks in advance!

The best way I think is to create a new task in the settings and importing there the current tabs.
And yes, the desired geometry is possible. You can create it easily, but it's not so intuitive in the beginning.
To do it you've to right-click on a tab and then you can see this menu:
It's most easy to create first the rows and divide the windows in each row then, else you might be stuck if you want to add a row above is not possible with the limited options in the menu.
This way you can create your desired geometry like you can see:
When you're satisfied with your windows you can open the settings and save your current configuration:
clicking the marked button imports then all your tabs with settings:
Saving the settings, is storing this Task in the file ConEmu.xml and is always available as option to select:
If you want to create a different script to configure conemenu you can read the settings in the xml-file from the created task including all the configuration:
The advantage in doing it with this visual help is that you can configure each window directly with the correct terminal (and perhaps even further settings), and that's saved together with the geometrical settings.
If you want it reduced really to the commands like in your question then I'd propose this page

Related

conemu - on startup open two windows and position them like i want

I don't know if that's possible.
I managed to have conemu open two tabs (with a custom name) on startup and cd inside the folders i needs, now my question is:
Is there any way to make conemu open two different tabs in two different windows and position them top-right-corner and bottom-right-corner?
The task i run on startup is the following:
title Website & cmd /k "%ConEmuDir%..\init.bat" && cd c:\src\www
title Other& cmd /k "%ConEmuDir%..\init.bat" && cd c:\src\other
Thanks
As always, read the documentation.
Use -new_console to open a separate window, play with tabs normally. Documentation.
If you’re lucky, the author of ConEmu will notice you and help you out better than I can.

Open multiple Microsoft Edge windows from batch file

I need to open 2 Edge windows from a batch file (not two tabs, 2 windows). I know I can launch edge using the following command:
start microsoft-edge:
But if I try it twice the second command does nothing. If I try it with URLs I get 2 tabs in the same window. e.g.
start microsoft-edge:http://google.com
start microsoft-edge:http://bing.com
Any ideas how to get 2 separate windows?
Use --new-window option:
start msedge http://google.com
start msedge --new-window http://bing.com
As you are aware, you can trigger Microsoft Edge indirectly from the command line (or a batch file) by using the microsoft-edge: protocol handler. Unfortunately, this approach doesn't enable you to open up an arbitrary number of windows.
The Microsoft Edge team built a small utility to assist, and presently hosts it on GitHub.
> MicrosoftEdgeLauncher.exe http://bing.com
> MicrosoftEdgeLauncher.exe http://stackoverflow.com
I just tested this, and it opened two individual windows for me. There does appear to be an issue where the second window doesn't navigate to the URL; remaining open with the New Tab Page.
You can open as many as you like, just create batch files that call other batch files.
Very easy to do.
Ex: batch1.cmd:
#echo off
start microsoft-edge:http://google.com
start "path\batch2.cmd"
exit
Make sure to add "start microsoft-edge:http://bing.com" on your "batch2.cmd" file
Manny
You can use the executable msedge_proxy.exe which is installed alongside msedge.exe. For example in "C:\Program Files (x86)\Microsoft\Edge\Application".
Sample usage:
> msedge_proxy.exe --app=http://bing.com
If you execute that command multiple times, it pops a new window each time.

How to pin to start menu using a batch file (Windows 10)

I need to pin an executable into the new Windows 10 start menu (i.e. creating a tile).
I'm aware of PowerShell scripts that do the job, but I need some instructions to add at the end of an existing batch file (cmd) we already use for installing our applications.
The usual scripts (valid for Windows 8 and 8.1) simply don't work. How can I do this?
This is a kludge work around that Microsoft needs to fix, but it worked for me.
Temporary rename the .bat file to .exe. Then right click on the file name. It will give you the Pin to start option. Pin it to the start menu. It won't work, but there is an option open the file location. Select that and change the name back to .bat. Now it works.
The way it works on Windows 10 after trying almost 15 different methods that didn't work for me
Go to your desktop -> right-click -> Create New Shortcut
In the shortcut target type the following text:
cmd /c "full path to your batch file"
It will look something like this:
cmd /c "C:\Users\Jmeter\Desktop\jmeter.bat"
Name the shortcut.
Right-click on the shortcut -> select Pin to taskbar. If you'd prefer it pinned to your Start menu, select Pin to start instead.
Bonus: Download some .png image -> Go here (https://icoconvert.com/) -> convert to Windows icon file -> set as new icon
Note: I've wrote and tested this on windows 8 - you might face issues on windows 10.
Check this. This a JScript/bat hybrid that uses the shellapplication object and invokeverb function (i.e. emulates right click and chooses some specific actions). It is now compatible with Windows 10.
Use it like this (you can use also a shortcut/.lnk to an exe):
call pinnerJS.bat "%windir%\system32\cmd.exe" startmenu
Follow my original method, and you will get .bat file{s} pinned in Taskbar. WORKS 100%
Step 1: Create shortcut of your .bat file (for example in Desktop “C:\Users\youruser\Desktop\yourfile.bat”). So you will end up with “yourfile.bat – Shortcut.lnk” (you might not see extension “.lnk”).
Step 2: Right Click your shortcut and change your Target field from: “C:\Users\youruser\Desktop\yourfile.bat” to: explorer “C:\Users\youruser\Desktop\yourfile.bat” – note: explorer is the explorer.exe app. You can also write the full Path: C:\Windows\explorer.exe, for no confusion.
Step 3: Now Right Click your shortcut and now you can see the option Pin to Taskbar.
Step 4: Right Click the pinned shortcut, and you will see two options: shortcut itself and unpin option. Right Click the shortcut and select Properties. From Target field delete “C:\Windows\explorer.exe” and leave only “C:\Users\youruser\Desktop\yourfile.bat”, and click OK
Now you can delete your shortcut in Desktop, since now you have your standalone shortcut on Taskbar
Optionaly, if you want to change Icon do Step 4, but now click “Change Icon…” button, and choose your custom Icon, from some other exe file or .ico file.
That’s it!
Now you have fully functional batch file shortcut on Taskbar
Right now, you can't do this with free tools (maybe Windows want to get into the "pay2tile" business model).
One possible option at the moment would be to use Classic Shell.

save entire cmd screen to image

I just finished writing a program, (download here if you're interested) Basically, it is like an etch-a-sketch. here's a screenshot of version 1:
Version 2 is more like a pixelated painting program. Here's a screenshot: As you can see, v2 supports 16 different colors.
Anyway, I want the users to be able to "save" their creations. I know that I can highlight everything, and copy it into a text file, but this does not get the colors, and there isn't a clean way to do this (that I know of).
Is there a command line tool that I can download to save screen output as an image? Or am I screwed?
By the way, This is just a batch file, compiled with This program. It only works compiled, because the compiler features advanced commands, the kind that allow me to have multiple colors in one window. You can check out the source code here. All lines starting with REM are the "advanced commands".
:edit
I was originally just going to go with a method that saves all of the text, but when I add colors, it looks something like this. Here is what it should look like:
You can use this commandline tool (I made it in AutoIt):
Capture.exe
Use :
capture.exe outputFile.jpg (png,bmp)
It will capture the entire screen.
EDIT :
You can use THIS new one :
Use :
Capture.exe "Title_of_the_Windows"
So in your bat, give a title to your CMD windows, using :
Title capture
and then display your colored text, and just make a :
Capture.exe "Capture"
This will create Output.jpg.
you can do this without external tools ,but you'll need .net framework (installed on windows from vista and above by default) and screenCapture.bat
call screenCapture screen.png png n

How to make a new file with the windows context menu

Using the registry I used the following code below to create a sub-menu in the windows context menu.
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Power Menu]
"MUIVerb"="Matt's Usefull Tools"
"SubCommands"="batmode;logoff;switch;sleep;hibernate;restart;safemode;shutdown;hybridshutdown"
"Icon"="C:\\Users\\Matthew\\Downloads\\Hacker.ico"
"Position"="bottom"
Now I want to be able to click a command I set and then have it create a .bat file where I right clicked, I know you can add this to the "New" sub menu by editing the ".bat" registry using the code.
[HKEY_CLASSES_ROOT\.bat\ShellNew]
"NullFile"=""
Now is it possible to implement this into my sub-menu?
i could get this only to work w/ following command:
CMD.exe /c #ECHO.>"%V\New File.bat"
Under HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\batfile\command
where "batfile" must be one of your "SubCommands".
the issue is, that this will always create the "New File.bat" in current location (e.g. Desktop).
If there's an existing "New File.bat" it will just overwrite it.
If you use CMD.exe /c #ECHO.>>"%V\New File.bat" and there's an existing copy of "New File.bat", it will just add whitespace to the file.
i do not know a way to Call "ShellNew" from "command". :/
Maybe it helps anyway.
Edit:
whoops... just saw that this is an one year old question ^.^
anyway - it may help somebody else. :)

Resources