How do I stop Visual Studio Code from opening after I try to execute a .pl file from Command Prompt? - command

I use command prompt to run a file.pl and every time I do Visual Studio Code keeps auto launching and showing me the lines of code. I don't want it to open, just run the file in command prompt.
see above, it's pretty self explanatory

Related

Is there a way to get the currently open file in VS Code via command line?

I'd like to get the full path of the currently open (last active) file in Visual Studio Code from command line to use in command-line scripts. There's a solution for referring to it in the integrated terminal. However, I'm using a separate terminal (Terminal.app on macOS).

How do I get Visual Studio Code to run from the directory of the Python file?

I am new to Visual Studio Code. I am using Windows.
When I hit the "Run Code" button at the top right, I want my .py file to run from the current directory.
When I hit Run right now, I get the Terminal window > Windows Powershell, which prints:
PS C:\Users\zack> python -u "c:\Users\zack\Desktop\test.py"
In other words, I want the .py file to run as if I did "cmd" then "cd directory".
I saw this question but I don't know where to type this.
I also saw this question and enabled Execute in File Dir. Didn't change anything.

Open file from integrated terminal in VS Code

I have VS Code setup with WSL on my Windows 10 machine. I am trying to find the command I can use to open an existing file from the integrated terminal in the current VS Code window.
I tried code filename, which launches a new VS Code window. I tried with code -r filename, but it also launches a new window.
Is there a way to quickly open a file when I'm focussed on the terminal?
As of version 1.43.1, this appears to now work as expected, without additional add ons.

In Visual Studio Code, launch a Console application in an external window

I have a Console application open in VS Code. When I press Ctrl-F5, the output of my program is displayed in a DEBUG CONSOLE window, along with other text.
How do I get Visual Studio code to launch my program in a new console window?
As documented here this can be achieved using this setting:
"console": "externalTerminal"
The settings file is in the solution directory: .vscode/launch.json .
When you're just using Tasks and not Launchers, you can follow the advice here.
For me on Linux, I changed my shell command in VSCode from command to gnome-terminal -e command. That did the trick; that's all I had to do.
Note that if you do this you can get rid of the presentation option set from your task.

How to ensure vsvars32.bat has run

I have a build process using MSVC 2005. It only works correctly if run from a Visual Studio command prompt, not from a regular command prompt, because of the additional variables that get set. It's far too easy to run the wrong type of prompt and then get obscure error messages, so I'm trying to avoid this. I don't want to change my regular command prompt to always call vsvars32.bat, since I don't always want this, but I wanted to add a message to suggest using the Visual Studio Command Prompt. To do this, I wrote a BAT file
if "%VSINSTALLDIR%" == "" echo Did you want a Visual Studio Command Prompt?
However, this also shows up in the Visual Studio Command Prompt because it gets called before vsvars32.bat does.
Does any one have any idea how I could get a message added to a normal command prompt but not the Visual Studio 2005 Command Prompt? I suspect from how the Visual Studio Command Prompt is set up this isn't possible.
Thanks.
Why not execute vsvars32.bat from within your build process? The other option is to explicitly spawn a shell using something like cmd.exe /k path-to-vs\vsvars.bat - IIRC, the /k option makes the shell execute the argument and remain open.