Ask coding questions

← Back to all posts
1
Is Windows Batch/Batch File Supported on Repl.it?

Are we able to run batch files?
For example:

echo This is my test prompt
echo Choose A or B
choice /c AB
if %errorlevel% == 1 goto 1
exit
1:
echo 1

gives

This is my test prompt
Choose A or B
[A,B] B
1

I know the Repl.it Servers and stuff are on linux, but there are many programs on linux that run batch. Even the editor recognizes batch.

Commentshotnewtop
1
[deleted]

I'm not sure about .bat extension but if you save it with .sh extension then it should run perfectly.

1
[deleted]

@HarperframeInc sadly, repl.it is Linux based too so it should be fine till you rename the file to .sh as both .sh and .bat have almost same format.

1
[deleted]

Or you could make a bat to sh translator.

1

@Harmeet_SinghSi There are many programs, such as wine, that run batch.