ID:991372
 
I'm trying to accomplish something like; psuedo-code:
shell("dm -o testsubject.dme > output.txt")


So I can create an XML table of a dynamically loaded BYOND environment..

I can't get it to output what I need, is it even possible to parse the return value into text file for this executable?
You might want put the structure of the directory (unless you copied dm.exe to the location of that project)

But a great way to test this before hand is cmd (command prompt)

cd to the BYOND directory (or where dm.exe is) and run it.

You'll find that

shell("dm -o testsubject.dme > output.txt")

Will become

shell("C:/Program Files/BYOND/bin/dm.exe -o testsubject.dme > output.txt")


And the project being hosted will have to be in another mode (ie not safe mode)

Since shell() allows arbitrary access to the system, each call requires authorization from the person hosting the world, unless running in trusted mode. Authorization is only sought when running in Dream Seeker, since Dream Daemon is intended to be non-interactive. Calling shell() with no arguments is a way of checking if it is allowed by the current safety settings. It will return true if running in Dream Seeker (regardless of safety mode) or if running in Dream Daemon in trusted mode.
DM.exe requires byondcore.dll so I cant relocate the file into my project. Calling dm is calling the executable located in my bin, as I can call DreamMaker and etc with no problems.

I opened the command window:
shell("cmd /K")

and dragged the corresponding files into the command prompt along with the arguments, I seemed to be successful in parsing output into the text file, but only if I do it manually.


However, no matter what I try in dream maker, I can't get it to simulate the same effect...
Like I said make sure the world is being hosted in Trusted mode, and see if that'll work.

Safe mode will only work in the directory where the .dmb file is.

With your first post you are calling dm but the shell doesn't know where it's located so you will have to have the C:/Program Files location in that snippet of code.