Support > General Discussions
Having trouble getting execute command to work
timm:
When I attempt to use the execute command I get the following error "(0): error &H1:Not enough memory"
For example the following code will cause the error.
--- Code: ---a = execute ("dir /b > list.txt", -1, pid)
--- End code ---
Any suggestions would be appreciated, this is a real sumbling block for me.
timm:
almost as soon as I posted this I discovered the solution, the following code works fine.
--- Code: ---a = execute ("cmd /c dir /b > list.txt", -1, pid)
--- End code ---
any way hopefully I will save some one some frustration.
Support:
Thanks Tim for the report on how you solved your problem.
Posting issues/solutions here helps others traveling the same road.
John
timm:
Ok, my problem isn't solved after all. I guess I found a poor work around, not a solution. The following code does produce the (0): error &H1:Not enough memory error.
a = execute("cmd /c attrib newtest.sb > tempattrib.txt" , -1, pid)
the only solution I can think of at the moment, would be to write the commands out as batch files and execute them that way, but I really don't want to, its just so cludgy
Interestingly the command does execute in isolation, so it must be using just a LITTLE to much memory the program that it executes in is less than 40 lines of code and doesn't do anything extreme with strings or arrays.
This is driving me nutz
Support:
Hi Timm,
I remember having an issue with redirects with execute under Linux where it would output to the screen instead of a file. I mentioned it to Peter and ended up using a shell script that called scriba and did the redirect stuff in a script.
I will give it a try under Windows and see if I can reproduce your problem. There may be a issue with execute and shell redirection and should be reported in the bug tracker.
John
Navigation
[0] Message Index
[#] Next page
Go to full version