X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Fri, 18 May 2012 14:35:28 +1000 From: Jason Hood User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: System() References: <92c86f75-e970-4998-94c6-56d6fbf885fe AT e15g2000vba DOT googlegroups DOT com> <1c38ca22-52f5-470e-813f-1af6ed5f21d4 AT m16g2000yqc DOT googlegroups DOT com> <9e4eebca-6004-4c60-990a-a02d0c251ec7 AT h19g2000yqj DOT googlegroups DOT com> <4facb41e AT news DOT x-privat DOT org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: $$5dknje$xhezw46m.news.x-privat.org Message-ID: <4fb5d194@news.x-privat.org> Organization: X-Privat.Org NNTP Server - http://www.x-privat.org Lines: 31 X-Authenticated-User: $$np02fmijtvj-bfao$k3 X-Complaints-To: abuse AT x-privat DOT org Bytes: 2241 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On 11/05/2012 22:07, Georg wrote: > Thank you Jason! I assume I could also write the line to execute into > an environment variable [setenv("doit", "notepad", 1);] and call that No, that won't work, as the environment is local to the process - once your manager exits, the variable is lost. Your manager has to write the actual batch file. Let's say your manager is called "manager.exe", you start it with "go.bat" and the program to run is "run.bat". go.bat: @echo off ::start the file manager manager :loop ::if the manager didn't create a file, it exited if not exist run.bat goto eof call run.bat del run.bat ::run the manager again, but let it know it's returning from a program manager -restart goto loop :eof run.bat: ::whatever program was selected by the manager @notepad ::one problem with this technique is having to take care of arguments ::in particular, you have to double up percent signs -- Jason.