Executing dos program from cygwin

Executing dos program from cygwin

Post by myusenetaccoun » Wed, 21 Jun 2006 03:52:17



Strange one really.
Script works on one PC (win2k) but not on another (win2k server).

The script cd's into a sub-directory and performs some actions.
Then does the following:
cd sub_directory
<Does some work>
cd ..
DosProg.exe

the output is "command not found"

Like I said, this works OK on one PC but not one another but I have the
'feeling' that 'sometimes' it does work.

What are the general do's and don'ts regarding executing dos programs
from cygwin? Any ideas why it works on one pC but not another?

I'll try and post a small test program tomorrow if there is nothing
glaringly obvious which someone can suggest.

Thanks

 
 
 

Executing dos program from cygwin

Post by Steven Din » Wed, 21 Jun 2006 21:53:42



> Strange one really.
> Script works on one PC (win2k) but not on another (win2k server).

> The script cd's into a sub-directory and performs some actions.
> Then does the following:
> cd sub_directory
> <Does some work>
> cd ..
> DosProg.exe

> the output is "command not found"

> Like I said, this works OK on one PC but not one another but I have the
> 'feeling' that 'sometimes' it does work.

> What are the general do's and don'ts regarding executing dos programs
> from cygwin? Any ideas why it works on one pC but not another?

> I'll try and post a small test program tomorrow if there is nothing
> glaringly obvious which someone can suggest.

> Thanks

Check the $PATH environment variable.

--
Steven Ding
Email: wjding<at>gmail.com

 
 
 

Executing dos program from cygwin

Post by Stev » Thu, 22 Jun 2006 02:58:01




>> Strange one really.
>> Script works on one PC (win2k) but not on another (win2k server).

>> The script cd's into a sub-directory and performs some actions.
>> Then does the following:
>> cd sub_directory
>> <Does some work>
>> cd ..
>> DosProg.exe

>> the output is "command not found"

>> Like I said, this works OK on one PC but not one another but I have
>> the 'feeling' that 'sometimes' it does work.

>> What are the general do's and don'ts regarding executing dos programs
>> from cygwin? Any ideas why it works on one pC but not another?

>> I'll try and post a small test program tomorrow if there is nothing
>> glaringly obvious which someone can suggest.

>> Thanks

> Check the $PATH environment variable.

Thanks but I'm in the directory where the program is so I shouldn't have
to worry about the path. In the end I've had to put the full path in the
call to the dos prog.

Never mind!

 
 
 

Executing dos program from cygwin

Post by Glenn Jackma » Thu, 22 Jun 2006 03:10:40





> >> DosProg.exe

> >> the output is "command not found"

> >> What are the general do's and don'ts regarding executing dos programs
> >> from cygwin? Any ideas why it works on one pC but not another?

> > Check the $PATH environment variable.

>  Thanks but I'm in the directory where the program is so I shouldn't have
>  to worry about the path. In the end I've had to put the full path in the
>  call to the dos prog.

You do have to worry about the path.  Is '.' in the PATH?  If not, then
a shell won't find it even in the current directory.  It would be
sufficient to change "DosProg.exe" to "./DosProg.exe"

--
Glenn Jackman
Ulterior Designer

 
 
 

Executing dos program from cygwin

Post by Stev » Thu, 22 Jun 2006 06:04:40






>>>> DosProg.exe

>>>> the output is "command not found"

>>>> What are the general do's and don'ts regarding executing dos programs
>>>> from cygwin? Any ideas why it works on one pC but not another?
>>> Check the $PATH environment variable.

>>  Thanks but I'm in the directory where the program is so I shouldn't have
>>  to worry about the path. In the end I've had to put the full path in the
>>  call to the dos prog.

> You do have to worry about the path.  Is '.' in the PATH?  If not, then
> a shell won't find it even in the current directory.  It would be
> sufficient to change "DosProg.exe" to "./DosProg.exe"

Ok thanks, I did not know. I'll check it out tomorrow but I'm pretty
sure I tried ./

Shall let u know

 
 
 

Executing dos program from cygwin

Post by Steven Din » Fri, 23 Jun 2006 00:19:25






>>>> DosProg.exe

>>>> the output is "command not found"

>>>> What are the general do's and don'ts regarding executing dos programs
>>>> from cygwin? Any ideas why it works on one pC but not another?
>>> Check the $PATH environment variable.

>>  Thanks but I'm in the directory where the program is so I shouldn't have
>>  to worry about the path. In the end I've had to put the full path in the
>>  call to the dos prog.

> You do have to worry about the path.  Is '.' in the PATH?  If not, then
> a shell won't find it even in the current directory.  It would be
> sufficient to change "DosProg.exe" to "./DosProg.exe"

Absolutely right! ^-^
My colleagues usually add "./" to $PATH on those shared machines and
they used to use "filename" to run the file in the current directory.
But when they forgot to add it on several workstations, they are strange
why it doesn't work. That's under Unix/Linux, but I believe Cygwin is
the same.

--
Steven Ding
Email: wjding<at>gmail.com

 
 
 

1. Problem with program doing serial communication under Cygwin

Dear colleages,

I have written a command-line program that uses the serial port (TTYS0) for
communication with an embedded device.

I need to port this program to Windows, so I tried to compile it under the
Cygwin environment. I changed the name of the serial port from '/dev/TTYS0'
to 'COM1:'.

The program compiles well, but when I start it, it terminates with an error
on the function tcgetattr(), although it goes well over opening the serial
port (see listing below). I'm getting error #25 "Not a typewriter".

Does anybody know why this is happening and can provide a solution?

Thank you very much in advance
ar

  if( (fhSerial = open(szSerialFileN,O_RDONLY)) == -1 ){
    BailOut("Unable to open the serial port!\n");
  }
  if( val == S_SET ){
    if( tcgetattr(fhSerial,&OldSerialMode) != 0 ){
/*DEBUG*/     printf("'%s' %i",strerror(errno),errno);
      BailOut("Unable to read the serial port settings!\n");
    }

2. Problems Creating Lots of Disks with VDM

3. bitkeeper cygwin messed up cygwin terminal setting for tcsh, lynx: dumb terminal?

4. Staroffice 4 mirror location

5. About cygwin: Why so many source code can not be compiled in linux cygwin?

6. Linux and WIN95!

7. Executing another program from C program

8. blank desktop on KDE 2.0.1

9. Executing a program (shell script) from within a c program

10. Executing programs within a program

11. Executing a program with in a program.

12. UNIX (Cygwin 32) programming on Windows NT

13. running a DOS program from C program under Linux ?