This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
vincybot's profile picture

How to open .bat files

Started by vincybot, 31 December 2012 - 01:23 AM
vincybot #1
Posted 31 December 2012 - 02:23 AM
Is it possible to open a .bat file from my turtle ? And how ?

I'm new to this mod and I just wanted to know if it was possible. Thank you.
Mendax #2
Posted 31 December 2012 - 02:47 AM
Well, you could write an interpreter… No default support. Sorry but you might just have to use Lua.
remiX #3
Posted 31 December 2012 - 02:57 AM
If your on windows then create a file called "toApis.bat" then in there put copy "PathToYourApi_ThisShouldBeFromYourAcctualComputerDrive" "PathToYourAPIFolder"
then to run that i think its either dofile "toApis.bat" or shell.run("toApis.bat"). PS. This may not work if computercraft doesn't support batch files any more

I have no idea what the hell you're smoking. ComputerCraft has never supported, and will never support, executing batch files. Especially not things that could touch files outside of the computer's directory itself.
vincybot #4
Posted 31 December 2012 - 03:21 AM
Can I do it using lua ? How ?
ChunLing #5
Posted 01 January 2013 - 12:10 AM
You can have a startup program, named startup, on your turtle. It will run whenever the turtle is turned on, unless you have a startup disk in a drive adjacent to the turtle.

If you're asking how to write a bat file interpreter…yeah, that's a bit trickier.