I am trying to copy a file from C:\Windows\System32 folder to C:\Windows\SysWOW64 folder using Fortran and/or C++ code(s).
Fortran code:
call system ('copy C:\Windows\System32\filename.extension C:\Windows\SysWOW64\filename.extension')
end
C++ code:
#include <iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
int main() {
system('copy C:\Windows\System32\filename.extension C:\Windows\SysWOW64\filename.extension');
return 0;
}
Execution of the codes above returns an error as follows:
The system cannot find the file specified.
When I enter
copy C:\Windows\System32\filename.extension C:\Windows\SysWOW64\filename.extension
on the Command Prompt in Administrator mode, it works fine and returns
1 file(s) copied.
Any idea how can I copy a file from C:\Windows\System32 folder to C:\Windows\SysWOW64 folder using Fortran and/or C++ programming languages?
Thank you very much in advance for your time and help in this matter,
Bakbergen