question

PiyushMhatre-4100 avatar image
0 Votes"
PiyushMhatre-4100 asked PiyushMhatre-4100 commented

Make a script (program) to do following things.

Hello

I have Windows 10 and I was facing keyboard problem in Turbo C++. "+" , "=" , etc keys were not working in Turbo C++.

So in order to solve this problem I have to do following steps :-

 1) Open CMD as administrator
    
 2) Run this command :- cd C:\TURBOC3\Turbo C++\DOSBox-0.74                    ..............[Press Enter]
    
 3) Run this command :- set sdl_videodriver=windib
                                        dosbox.exe                                                                    .........................[Press Enter]  
                                          
 4) Close CMD.

As you can see I have to do these following steps everytime I want to use the Turbo C++. So my question is that can I make a script or a programs that runs these steps when I run the program made by me.

For better understanding :-- Example :--- When I run Turbo C++ it opens dosbox, locate turbo.exe and runs it in dosbox actomatically and we are good to go. So my question is that how to make a program that runs the 4 steps I mentioned above automatically so I don't have to copy-paste and run this commands everytime. I hope you were able to understand my point ��. Thankyou. ��

small-basic
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Scout-1150 avatar image
1 Vote"
Scout-1150 answered PiyushMhatre-4100 commented

Hello Pi,
here is an example of how a batch file can be called using Small Basic.
The first thing to do is to import the demo with the ID: FSLM912.000.
The program should be saved in any directory.

82477-greeting2021.png

The batch file Dir.dat must be created in this directory with a text editor. For example, the lines after the TYPE command from the following DOS box can be used.

82552-batchfile.png

After clicking on Batchfile a DOS box is opened and the commands of the Dir.bat file are executed. The DOS box closes automatically if the PAUSE command is not used at the end.
All commands listed in the HELP of the DOS box should work.


greeting2021.png (90.2 KiB)
batchfile.png (69.9 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

But I don't know what these commands does. Can you please tell me what commands I have to use so that I will learn about them and make a .bat file by using that commands. Thankyou.

0 Votes 0 ·
Scout-1150 avatar image Scout-1150 PiyushMhatre-4100 ·

Just try it.
Create a text file e.g. Turborun.bat with the following lines:
CD / D C: \ TURBOC3 \ Turbo C ++ \ DOSBox-0.74
SET sdl_videodriver = windib
dosbox.exe
After saving, simply start the batch file by entering Turborun.


1 Vote 1 ·

Ok I made a .bat file and pasted these commands and its works perfectly and saves a lot of time thankyou.

0 Votes 0 ·