P
Pegboy
I am using Turbo C++ 3.0 for DOS. {I know... old tools.}
I am trying to execute "command.com /c ren file1.ext file2.ext" using
spawnl().
I am aware of rename() and system(), but I need to use command.com to do
this, if at all possible. Several have told me it is.
My attempts are all similar too:
i = spawnl( P_WAIT, "command.com", "command.com", "/c", "ren",
"file1.ext", "file2.ext", NULL );
The return value (i) is always -1, with errno indicating ENOENT or "No such
file or directory.".
I've have found many examples using spawnl(), however not with command.com,
and they all lead me to think I'm on the correct path. Can anybody help me
solve this situation?
I have even attempted something simple like "cls" rather the renaming... no
go.
Somebody said that I should also use getenv() to return the correct form of
command.com, but its not clear why or how.
Any help would be greatly appreciated. Thank you in advance.
I am trying to execute "command.com /c ren file1.ext file2.ext" using
spawnl().
I am aware of rename() and system(), but I need to use command.com to do
this, if at all possible. Several have told me it is.
My attempts are all similar too:
i = spawnl( P_WAIT, "command.com", "command.com", "/c", "ren",
"file1.ext", "file2.ext", NULL );
The return value (i) is always -1, with errno indicating ENOENT or "No such
file or directory.".
I've have found many examples using spawnl(), however not with command.com,
and they all lead me to think I'm on the correct path. Can anybody help me
solve this situation?
I have even attempted something simple like "cls" rather the renaming... no
go.
Somebody said that I should also use getenv() to return the correct form of
command.com, but its not clear why or how.
Any help would be greatly appreciated. Thank you in advance.