delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2012/05/18/00:45:17

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 <jadoxa AT yahoo DOT com DOT au>
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> <fea067ab-ee56-4b9e-bb73-ed3365fb9d59 AT ee2g2000vbb DOT googlegroups DOT com> <9e4eebca-6004-4c60-990a-a02d0c251ec7 AT h19g2000yqj DOT googlegroups DOT com> <b16ff03e-0f4a-4c05-93f8-e8ce37b34ef8 AT n4g2000vbz DOT googlegroups DOT com> <4facb41e AT news DOT x-privat DOT org> <e1b4c24c-5e9a-4825-a30b-c353b8db2dae AT p1g2000vbv DOT googlegroups DOT com>
In-Reply-To: <e1b4c24c-5e9a-4825-a30b-c353b8db2dae@p1g2000vbv.googlegroups.com>
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019