I recently switched to Windows 11 and I'm trying to use Windows Terminal (wt.exe) more instead of cmd.exe.
In Windows 10 and Windows 7, I used to have many batch files that would launch cmd.exe and issue commands using the /c option. Like this:
cmd.exe /c mkdir "c:\Users\mike\Desktop\newfold" & start "" "c:\Users\mike\Desktop\newfold"
Now, how can I do this with Windows Terminal? Anything like
wt.exe --c mkdir "c:\Users\mike\Desktop\newfold" & start "" "c:\Users\mike\Desktop\newfold"
Thank you,
-Stephanie
CMD.exe to Windows Terminal Porting: command line commands
Moderator: DosItHelp
Re: CMD.exe to Windows Terminal Porting: command line commands
Windows terminal does not replace cmd.exe
https://devblogs.microsoft.com/commandl ... -2019-faq/
https://devblogs.microsoft.com/commandl ... -2019-faq/
Re: CMD.exe to Windows Terminal Porting: command line commands
Don't confuse shell applications (like CMD or PowerShell) with terminal applications (like conhost.exe or wt.exe). It's critical to understand the difference. First ingest "CMD.EXE DOES NOT HAVE A WINDOW!", then read how this goes together with the fact that you are used to seeing a window as soon as you run it:
https://github.com/microsoft/terminal/b ... s-terminal
However, you can make Windows Terminal the default terminal application used by programs with a command line interface. That means, shell applications and shell scripts will then automatically run in the Windows Terminal instead of the Console Host.
Steffen
https://github.com/microsoft/terminal/b ... s-terminal
However, you can make Windows Terminal the default terminal application used by programs with a command line interface. That means, shell applications and shell scripts will then automatically run in the Windows Terminal instead of the Console Host.
Steffen
Re: CMD.exe to Windows Terminal Porting: command line commands
TBH, you should ideally look into the reason why you're doing that at all.
The batch files are already being run in a cmd.exe instance, so there is no reason why you should need to be invoking two commands in a new instance, or one command in a new instance like that.
Two commands in a new cmd.exe instance:
Code: Select all
%SystemRoot%\System32\cmd.exe /D /C "MD "%UserProfile%\Desktop\newfold" & Start "" "%UserProfile%\Desktop\newfold""
Code: Select all
%SystemRoot%\System32\cmd.exe /D /C "MD "%UserProfile%\Desktop\newfold"" & Start "" "%UserProfile%\Desktop\newfold"
Code: Select all
MD "%UserProfile%\Desktop\newfold" & Start "" "%UserProfile%\Desktop\newfold"