
-----------------------------------
mirhagk
Mon Dec 14, 2009 10:48 am

Running Batch Files
-----------------------------------
What is it you are trying to achieve?
Trying to create and run a batch file


What is the problem you are having?
Turing always tells me that it fails


Describe what you have tried to solve this problem
Sys.Exec


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)



open : stream, "compile tools/run.bat", put
        put : stream, "a86 temp.asm"
        close : stream
        if ~Sys.Exec ("compile tools/run.bat") then
            put "For unknown reasons system could not compile program"
        else
            put "The file compiled correctly and is now placed" ..
            put " in the same folder with the same name as the source"
        end if



Please specify what version of Turing you are using
4.1.1

-----------------------------------
DemonWasp
Mon Dec 14, 2009 10:59 am

RE:Running Batch Files
-----------------------------------
Spaces in directory names are usually a bad plan. Try on a batch file in a directory without spaces anywhere in the path, such as C:\compile_tools\run.bat .

Also, errors don't have to be unknown. Turing has some facilities to track the current error.

-----------------------------------
mirhagk
Mon Dec 14, 2009 11:30 am

RE:Running Batch Files
-----------------------------------
oh yeah sorry man, lol made this at 5 am last night, haven't really slept today, not really thinking.

-----------------------------------
DtY
Mon Dec 14, 2009 6:33 pm

RE:Running Batch Files
-----------------------------------
Dunno if it works in Windows, but if you want a space in a directory, you can escape it with a slash in front of it. Since this isn't escaping in Turing, you have to escape the slash for turing.

So, "\\ "

[edit] Disregard that. Backslash is the directory separator in Windows, so that won't work. There's probably some way to do it though.

-----------------------------------
mirhagk
Mon Dec 14, 2009 11:31 pm

RE:Running Batch Files
-----------------------------------
it works when writing, moving, deleting files, but spaces are not allowed in Sys.Exec
