If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Xcopy between two servers

Hi everyone, I am trying to move files from one folder (server 1) to another folder(server 2) through command xcopy . I am using the editor dev c++. My code works fine if i have to move file within single server but gives error " Invalid parameters " if i am trying between servers.

while(1)
{
time(&stop);
if(difftime(stop, start)== 60) // moving file after every one min
{
//abc is my folder and have to move to test folder of another server
//have replaced server name wid server 1 and 2

Re: Xcopy between two servers

I doubt that any console command is capable of handling network paths that aren't mapped to a drive letter.

I've had some really bad side-effect from trying to run a .bat file when I wasn't on a mapped network path. The shell defaulted to open in the c:\windows, I was running as admin and the bat file contained del /S *.exe. Well you might guess the result...

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan

Re: Xcopy between two servers

I do use xcopy within a .bat file sucessfully...

EDIT:
OR you can do as Igor suggest in the next post...

BUT

also agree with VictorN...I find SHFileOperation easier to use within C++ than a "system" call plus you can also get a progress bar for the file operation. Give SHFileOperation a try...if you need help just give a shout for a sample...

HTH...

Last edited by Vanaj; May 4th, 2012 at 01:48 AM.
Reason: tech...

Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII

"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.

"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.

Re: Xcopy between two servers

Nope. It's Windows XP SP3, and you take my word I did this even back in Windows NT4 ages.

The real difference between the cases, mine and yours, is that mine has paths fully specified while yours might rely on current directory. The latter really must be set to some letter drive based path, otherwise it's &#37;WINDIR%\system32 that automatically implied.