[comp.os.msdos.programmer] EXEC'ing command.com /p

joefritz@pawl.rpi.edu (Jochen M. Fritz) (12/11/90)

This is a repost from alt.msdos.programmer.  I got one piece of advice, that
did not solve the problem.  For this reason, I am reposting this in the 
hope that more readers will see it (and reply?).  Sorry if you already
read this on the alt group, but I did not get any answers there.

I have been unsucessful in spawning a copy of comand.com that reads the 
autoexec.bat file.  The shell starts up prompts for the date+time  (same 
as if it couldn't find an autoexec, then refuses to exit (the other effect 
of /p)  I have tried entering command /p from both command.com and  mssh,
and they did read the autoexec.bat file.  For some reason, it only refuses
to do so for my programs.  What am I doing wrong?

The details:
DOS 3.2
640K RAM
language:  Turbo C++ and Turbo Assenbler (the routine is written in TASM)

function used: 4B  (sub 0)  (Load and execute subtask)

contents of DOS call 4Bh barameter block  
(this is from memory, they may not be in the right order)
command line  (ptr to [02,'/','p',0Dh]
env NULL  (use current)
FCB(1+2) NULL

PS, no flames about why I would want to spawn a permanant shell.  I did create 
a backdoor  :)

------------------------------------------------------------------------
| Jochen Fritz            | For though we live in the world, we do not |
| joefritz@pawl.rpi.edu   | wage war as the world does.-- 2 Cor. 10:3  |      
| usergk2s@rpitsmts.bitnet| You have heard it said, Love your neighbor |
| Noah [the peace monger] | and hate your enemy.  But I tell you: Love |
|                         | your enemies.  Matt. 5:43-44               |
------------------------------------------------------------------------

noesis@ucscb.UCSC.EDU (60276000) (12/11/90)

try "exec command.com /p /c autoexec.bat"; the /c will force command to execute
the autoexec.bat file. probably want to change to the dir w/ autoexec in it as
a primary spawn will ignore anything in the current environment.

einari@rhi.hi.is (Einar Indridason) (12/12/90)

In article <3-D^-&%@rpi.edu> joefritz@pawl.rpi.edu (Jochen M. Fritz) writes:
>
>I have been unsucessful in spawning a copy of comand.com that reads the 
>autoexec.bat file.  The shell starts up prompts for the date+time  (same 
>as if it couldn't find an autoexec, then refuses to exit (the other effect 
>of /p)  I have tried entering command /p from both command.com and  mssh,
>and they did read the autoexec.bat file.  For some reason, it only refuses
>to do so for my programs.  What am I doing wrong?
>

/p should be /P
(upper case)


--
Internet:    einari@rhi.hi.is        |   "Just give me my command line and drag
UUCP:    ..!mcsun!isgate!rhi!einari  |   the GUIs to the waste basket!!!!"

General Surgeons warning:  Masking the 8th bit can seriously damage your brain!!