...suspecting that this requires nircmd.
I want to open the current path in console, but with a condition: if exist wt = open in wt, else in cmd
Need help with Batch: if exist wt = open in wt, else in cmd
Moderators: Hacker, petermad, Stefan2, white
Need help with Batch: if exist wt = open in wt, else in cmd
OS: Win10 | TC: latest x64
Re: if exist wt = open in wt, else in cmd
It couldn't harm if you would be more explizit.
What means "wt" for you?
Windows Terminal?
What do you mean by "cmd" ?
The Windows command line interpreter CMD.exe?
What means "wt" for you?
Windows Terminal?
What do you mean by "cmd" ?
The Windows command line interpreter CMD.exe?
Re: if exist wt = open in wt, else in cmd
You mean something like this:Save as e.g. WT_CMD.cmd and place it in %SystemRoot%. Drag it onto the button bar to create a new button. That should be all (you might need to make the current working directory empty).
PS: No idea if wt.exe exists in system32 directory; change the path if necessary.
Code: Select all
@echo off
setlocal
set CMD=%SystemRoot%\system32\cmd.exe
set WT=%SystemRoot%\system32\wt.exe
if exist "%WT%" (
call "%WT%" %*
) ELSE (
call "%CMD%" %*
)
endlocal
PS: No idea if wt.exe exists in system32 directory; change the path if necessary.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- jonathanpoulin
- Member
- Posts: 131
- Joined: 2020-12-19, 12:09 UTC
- Location: Saint-Marc-des-Carrières, QC Canada
- Contact:
Re: if exist wt = open in wt, else in cmd
2KozakMak
I don't know if this is relevant in your case, but it can worth it to check your Windows Terminal app settings. If its setting 'Default terminal application' is set to "Windows Terminal", then running cmd.exe will be opened in Windows Terminal app automatically for you. The same goes for powershell.exe and pwsh.exe.
I don't know if this is relevant in your case, but it can worth it to check your Windows Terminal app settings. If its setting 'Default terminal application' is set to "Windows Terminal", then running cmd.exe will be opened in Windows Terminal app automatically for you. The same goes for powershell.exe and pwsh.exe.
Thanks,
Jonathan Poulin
Jonathan Poulin