Use Windows Terminal in place of cmd when a command line exe is executed - windows-terminal

I have a couple command line apps (launch4j + java.exe) I use.
I'd like to run them on Windows Terminal instead of cmd.exe. But, even after installing Windows Terminal, when I execute the launch4j exe, it still runs on cmd.exe.
If I run wt myapp.exe -oneinput it works, but I'd like to run myapp.exe directly.
Is there any setting I must do so that Windows Terminal is used in place of cmd.exe?

The Windows Terminal team are working to enable Windows Terminal to become the default command-line user experience on Windows.
Stay tuned to the Windows CommandLine Blog for news and updates on up-coming features.

Related

How to change the terminal in windows to a custom one

I want to change the cmd or powershell in windows to a custom executable file created by me as a terminal that can run windows command.
How can i do it

Why does this command work in Terminal but not in CMD?

Dopusrt.exe /acmd Go "c:/"
The above command works, last active Window goes to c:/ but the below command does not work.
Dopusrt.exe /info documents\filelist1.txt,listsel,0
The weird thing is it works just fine in Windows Terminal. Does CMD reserve commas for something? I really need to use CMD in this case, Since Auotohotkey seems to only speak to CMD.
Thank you.
CMD and Windows Terminal are not the same type of application. CMD is a shell, and WT is a terminal. See this post for more details.
You can run any shell you'd like in WT - CMD, PowerShell, whatever.
CMD.exe does not by itself reserve commas (to the best of my knowledge). And running cmd.exe in WT vs running it in conhost (the default console on Windows) shouldn't make a difference either.

How to use native windows commands in VsCode`?

I have installed a command prompt shell in Visual Code and I have a compiler that I usually run from the windows cmd. I'm wondering how can I make the windows commands (and my own) that works in cmd run in the Visual Code Command prompt?

Running programs via shell

I am running Windows 7x64 and Excel 2010x32. I call 32bit dos programs (written in Fortran) via vba using ExecCmd (a Microsoft function that waits for a command prompt process to finish). I send a command line to this function that explicitly contains the program path and the paths of the input file and output file.
This runs fine on my PC and also on a company PC running the same software (OS and Office) and for which I have general access to the C: drive.
On other company PCs, where there is not general access to the C: drive, this does not work - i.e. the dos programs do not produce an output file. On these PCs, I can still run the program at the command prompt manually. It is just that calling this command prompt does not work via Excel VBA.
Now the strange thing is that I can successfully run one of these programs by adding "cmd.exe /c" at the beginning of the command line. That would appear to be running a command prompt within a command prompt (!). The other program (which, incidentally, is quite a bit bigger) does not work at all via vba on these PCs. I need to be able to provide other employees with something that works.
Can anyone shed some light on what is happening here and suggest a work around? I could past some code, but I think the above should be self explanatory.
You're confusing the command shell with the console window. In this context, the distinction is critical.
Console-mode programs (aka "command-line programs") require a console window to provide input and output. When a console-mode program is launched from a GUI program, Windows automatically creates a console window for it (unless instructed otherwise).
The command shell (aka "Command Prompt") is cmd.exe, a console-mode program.
The important point here is that not every console window has an instance of cmd.exe running in it. When a console-mode program is launched from a GUI program, Windows automatically creates a console window but does not automatically create an instance of cmd.exe. If you want to pass a command to cmd.exe you have to do so yourself, or use a run-time library routine that does it for you.
ExecCmd does not do this; it runs the program directly. So passing cmd /c <command> to ExecCmd is not "running a command prompt within a command prompt" at all. Without the cmd /c you aren't running a command shell command, you're just launching an executable.
There are any number of reasons why the command you're passing might need to be given to the command shell. For example:
it might be a built-in command like dir or type which only exists within the command shell;
it might include redirection or pipelining operators, or environment variable substitution;
it might be a script rather than an executable.
There are other cases. If you show us the command line being passed to ExecCmd we may be able to provide more specific advice. (The fact that the same command line is apparently working on some machines is puzzling, but can't be addressed without more information.)

Command line does not execute my parameters

I have created a batch file to run an application automatically but it seems my CMD does not run it. I typed this (using notepad as an example):
CMD /C "C:\notepad2\notepad2.exe"
If I run this from Windows Vista it worked. But running this from Windows Server 2008 (64-bit) it just doesn't work. I even try using that line from the Run menu but no go.
What do I do? My aim is to run a scheduled task that runs the batch file every now and then.
Stupid question, but does the program you're trying to run actually exist on the Server 2k8 machine?
There are no differences in cmd between Vista and Server 2k8 whatsoever.
Besides, why do you need to execute it via cmd? Can't you just run the application directly? Using cmd /c is only necessary for shell built-ins, such as dir or start.
Also remember that there is no NTVDM on 64-bit Windows—you can't run 16-bit programs. I doubt one would still use them nowadays but it may be the only thing I can think of why it doesn't work in 64-bit.

Resources