Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: ConEmu Windows terminal in jscript panel (Read 1806 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

ConEmu Windows terminal in jscript panel

This guide will describe how to add a ConEmu panel inside foobar2000.



What is ConEmu?
https://conemu.github.io/en/
ConEmu-Maximus5 is a Windows console emulator with tabs, which presents multiple consoles and simple GUI applications as one customizable GUI window with various features.

What will we achieve?
We will have a panel inside foobar2000 to run command line applications and simple GUI windows.

Installation.

1. Install ConEmu from https://www.fosshub.com/ConEmu.html ( you can use any version x86 or x64 )

2. Run ConEmu and change the following values in settings.
2a. Main > Appearance  - Select Single instance mode
2b. Main Taskbar - Deselect Close ConEmu with last tab

3. In an empty jscript panel http://www.foobar2000.org/components/view/foo_jscript_panel add the following code.

for x86
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");

hex = window.ID.toString(16);

var cmd = "cmd /c \"" + "\"C:\\Program Files \(x86\)\\ConEmu\\ConEmu.exe\" -insidewnd " + hex + "\"";
fb.trace(cmd);
WshShell.Run(cmd, 0, false);

for x64
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");

hex = window.ID.toString(16);

var cmd = "cmd /c \"" + "\"C:\\Program Files\\ConEmu\\ConEmu64.exe\" -insidewnd " + hex + "\"";
fb.trace(cmd);
WshShell.Run(cmd, 0, false);

You should now have the ConEmu panel hooked inside your jscript panel to use anyway you please.
You can dragndrop files from your playlist to the command window to process.

For jscript programmers you can "attach" your commands from another jscript panel  using the following code:

Code: [Select]
cmd = "cmd /k \""+ "\"C:\\Program Files \(x86\)\\ConEmu\\ConEmu\\attach.cmd\" & " + "add_your_command_here" + "\"" ; 

WshShell.Run(cmd, 1, true);