Never mind question answered
Never mind question answered
Last edited by Tjm7777; 04-11-2009 at 10:06 PM.
someone?
As i understand you want to make a program which will move a file to a different location on your hard drive. I have 2 solutions:
1)you can use "system" function from stdlib.h(as i think) which executes commansd from your system like you are in a command promt.for example calling function like this
system("copy autoexec.bat c:\windows"); will call copy command to copy autoexec to c:\windows dir.
2)you can manually make the move you want, use fopen function to open the file AIM.exe
read every byte of it with fread function and write every byte to a new created file on the dir you want(C:\Documents and Settings\user\Start Menu\Programs\Startup). Then delete the old file(the file from your desktop) using del command and system function.
You can find 1000 ways to make move your file
Or, if you want to use the Windows API functions, you can use:
MoveFile Function (Windows)
or
CopyFile Function (Windows)
Which you want to use depends on whether you actually want to COPY or MOVE the original file.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.