OK=Oleg, DB= me

OK>  What syntax I found working is using parentheses

Hadn't thought of that.  Good point.

DB>  See  cmd  /help 
 
OK>  read cmd /? 

Yeah, whoops, that's what I meant.  

DB>  You have a couple of options.  Use the syntax:
DB>                shell '"C:\amisc\sound\music\Fifties" & "Sixties\renLen.bat"'
DB>     pshaw

OK>  I don't believe this syntax will work.

It does. Try it.  That was an actual snippet from my J session.  (I'd created 
the directory structure and a batch file that printed "pshaw").

DB>  You might want to consider using both the lpApplicatioName and 
lpCommandLine parameters in the
DB>  definition of CreateProcess.

OK>  How will it help?

See postscript for new jtask definitions that use both lpApplicationName and 
lpCOmmandLine:

           shellB_jtask_ '"C:\amisc\sound\music\Fifties & Sixties\renLen.bat"'
        this is a test
        (pshaw, you don't mean it)

-Dan

PS:

        cocurrent 'jtask' [ ORIG_z_ =: coname ''
        
        CreateProcessFB =: 'kernel32 CreateProcessA i *c *c i i i  i i i *c 
*c'&cd
        
        CreateProcessB  =:  1 : 0
                '' CreateProcess y
        :
                'ow ir'=. 2{.x,0
                si=. szero STARTUPINFO
                si=. (sint #STARTUPINFO) 'Cbyt' sset STARTUPINFO si
                f=. inh=. 0
                if. +/ir,ow do.
                  inh=. 1
                  f=. CREATE_NEW_CONSOLE
                  si=. (sint STARTF_USESTDHANDLES+STARTF_USESHOWWINDOW) 'Flag' 
sset STARTUPINFO si
                  if. ow do.
                    si=. (sint ow) 'Outh' sset STARTUPINFO si
                    si=. (sint ow) 'Errh' sset STARTUPINFO si
                  end.
                  if. ir do. si=. (sint ir) 'Inph' sset STARTUPINFO si end.
                end.
                pi=. szero PROCESSINFO
                'r i1 c i2 i3 i4 f i5 i6 si pi'=. CreateProcessF m;y;0;0;inh; 
f;0;0;si;pi
                if. 0=r do. 0 return. end.
                ph=. int 'Proh' sget PROCESSINFO pi
                th=. int 'Thrh' sget PROCESSINFO pi
                CloseHandle th
                ph
        )
        
        spawnB  =: 1 : 0
                '' spawn y
        :
                'or ow'=. CreatePipe 1
                'ir iw'=. CreatePipe 2,#x
                ph=. (ow,ir) m CreateProcess y
                CloseHandle ow,ir
                if. #x do. x WriteAll iw end.
                CloseHandle iw
                r=. ReadAll or
                CloseHandle or,ph
                r
        )
        
           
        shellB  =: 'cmd' spawnB
           
        
        erase 'ORIG_z_' [ cocurrent ORIG_z_ 
        
        shellB_z_      =: shellB_jtask_  

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to