0

I'm trying to create a script in an application. The application should call cmd.exe and cmd.exe should run a statement

pushd \\file\share && move filename.txt \\file\share\newfilename.txt && popd 

But this generates an error in an application

Program terminated with exit code <1>

When I run the same statement just replace move with copy, everything works fine

pushd \\file\share && copy filename.txt \\file\share\newfilename.txt && popd

Also ren and del are producing the same result as move. Any ideas why this is happening? All these works from the command prompt just fine.

jrara
  • 209
  • 2
  • 6
  • 14

1 Answers1

0

This will most likely be a permissions issue. To move the file you need to have permission to delete (modify) both the source and the destination. This also explains why del and ren fail while copy works (only write permission required).

user9517
  • 115,471
  • 20
  • 215
  • 297
  • Thanks. Maybe it is a permission problem, but I cannot understand why move command works from the command line using the same crendentials... – jrara Jul 22 '11 at 11:52
  • @jrara: You should add that information to your question. – user9517 Jul 22 '11 at 12:01