I know using External Tools options i can run a batch script or a cmd prompt. But here is what i need to do
I want to be able to call a dos prompt inside visual studio, which must be interactive. That way i won't be outside visual studio and can run all my dos commands in it. Is it possible? Or can i extend the command window and capture the commands which are typed and process them using my custom code?
Thanks
There's the Tools.Shell command which may work for you. You use the /c switch to specify that the output for the executable is displayed in the Command window. Then you call cmd.exe with /C switch which instructs it to close after finishing the command. For example if you type:
Tools.Shell /c cmd.exe /C dir C:
This will print the output to the Command window. Unfortunately, unlike the output, the input doesn't work. So if you type:
Tools.Shell /c cmd.exe /C pause
The prompt will not wait for your input (pressing a key).
If that's OK for you, you can even define an alias for most of this. For example you define alias sh for Tools.Shell /c cmd.exe /C:
alias sh Tools.Shell /c cmd.exe /C
Then you simply use it as follows:
sh dir c:
If you install NuGet, then it adds Package Manager Console to Visual Studio which is essentially a Powershell command prompt. There should be ways of doing most DOS stuff via Powershell and heaps more functionality as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With