While using the Windows machine we face soo much trouble running the command line scripts on CMD(command prompt). Few commands run successfully but some are not. Why is there any difference between terminal and CMD.
The question needs details, like what type of script you're attempting to run, and the specific errors you're getting.
Generally speaking, by default Windows Terminal launches a PowerShell interpreter (but can launch others), whereas cmd.exe launches a command interpreter that's much older and has no PowerShell functionality.
If you're attempting to run a PowerShell script, it needs to be in a PowerShell session (start either PowerShell, PowerShell ISE, Windows Terminal with a PowerShell tab, or if you really want to, you can run in a cmd.exe window by invoking
powershell.exe -File MyScript.ps1).
If it's a batch file, either interpreter can run it.
If it's a shell script, it's most likely meant to be executed on Linux.