[so] Tema1 - Problema mini-shell Windows la citirea / executarea comenzilor simple

Sergiu Iordache sergiu.iordache at gmail.com
Thu Aug 6 15:13:34 EEST 2009


On Thu, Aug 6, 2009 at 3:05 PM, ana-maria lepar<amylepar at gmail.com> wrote:
> Sal,
>
> Multumesc mult. Am rezolvat:).
> Acum alta buba daca dau Exec(dir) imi esueaza comanda .
> Am rulat si codul din laborator
> http://cs.pub.ro/~so/index.php?section=Laboratoare&file=03.%20Procese#Exec
> si am acelasi rezultat.
> ===========================================
> C:\Documents and Settings\ana\Desktop\ami\so>exec.exe
>
> C:\Documents and Settings\ana\Desktop\ami\so>dir
>  Volume in drive C is OS
>  Volume Serial Number is 7465-7659
>
>  Directory of C:\Documents and Settings\ana\Desktop\ami\so
>
> 08/06/2009  03:04 PM    <DIR>          .
> 08/06/2009  03:04 PM    <DIR>          ..
> 08/06/2009  03:04 PM             1,048 exec.cpp
> 08/06/2009  03:04 PM            37,376 exec.exe
> 08/06/2009  03:04 PM             1,472 exec.obj
>                3 File(s)         39,896 bytes
>                2 Dir(s)  138,304,294,912 bytes free
>
> C:\Documents and Settings\ana\Desktop\ami\so>
> ===========================================
>
> Intrebarea este de ce?

Nu merge pentru că schimbarea directorului este o comanda interna a
shell-ului(prin urmare nu se apelează cu exec). De aia trebuie să
apelezi SetCurrentDirectory[1]

Baftă,
Sergiu

[1] http://msdn.microsoft.com/en-us/library/aa365530(VS.85).aspx


More information about the so mailing list