QuestionMoveFile() help

Posts 1–5 of 5 · Page 1 of 1
MoveFile() help
Im am attempting to create proggram that can install files from C:\ to their needed locations in combat arms folder. It compiles with no problem but
so far i have only been able to create the folder, it woln't copy the file into the new folder.
Here's my code.
Code:
#include <windows.h>
#include <iostream>


using namespace std; 
  
int main () 
{ 
    CreateDirectory("C:\\test", NULL); //self explanitory
    cout<<"attempting to move file..." << endl;
    MoveFile("C:\\test.txt" "C:\\test", NULL); //heres the problem
    cout<<"Press ENTER to exit..." << endl;
    cin.get(); 

    return 0;
}
Anyone have any ideas why it wolnt copy? I am using Dev-C++.
#include <windows.h>
#include <iostream>


using namespace std;

int main ()
{
CreateDirectory("C:\\test", NULL); //self explanitory
cout<<"attempting to move file..." << endl;
MoveFile("C:\\test.txt", "C:\\test", NULL); //heres the problem
cout<<"Press ENTER to exit..." << endl;
cin.get();

return 0;
}

try MoveFile("C:\\test.txt", "C:\\test", NULL); //heres the problem <- with coma there , it might work? No time to try
thanx that worked

hey loook a usefull choob who knows what hes talking about!!! thats a first. congrats
hehe , thanks , im quite few months around here , i don't post much , but yea , im coder so.. i know these things.. a bit :$

OrX
and anyways , that part of code
//
cout<<"Press ENTER to exit..." << endl;
cin.get();
//

It would be easyer if you would use system("PAUSE"); instead of using two lines of code :P but its all up to you.. youknow
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us