2

I am trying to create a folder on a remote machine by running the batch file from teamcity and then copy source into that folder but it seems to be not doing. Using following code to create and copy

SET dirTempBackup=\\server1\BackupStorage\temp\test
SET Current=\\server1\web\BuildEnvironment\test

 ECHO Starting to copy files.
 IF NOT EXIST "%dirTempBackup%" MKDIR "%dirTempBackup%"
 IF NOT EXIST "!Current!" (
ECHO ERROR! Not found: !Current!
 ) ELSE (
ECHO Copying: !Current!
SET Destination=%dirTempBackup%\!Current:~0,1!
REM Directory.
XCOPY "!Current!" "!Destination!" /v /c /i /g /h /q /r /y /e
)

using the temp directory as compressing it later and then deleeting it at the end. Teamcity is generating Access is denied. and Copy failing due to Invalid path. Have checked teamcity user has full rights on that folder.

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
sam
  • 4,594
  • 12
  • 61
  • 111
  • 1
    What identity is it running under? Has that identity got permissions on the share? (NetworkService would be something like domain\MACHINE$ but LocalService etc. us going to have no rights) – Ruben Bartelink Oct 31 '11 at 14:50
  • Also, if you're looking to deploy a website, WebDeploy isnt pain-free but is the right tool for the job – Ruben Bartelink Oct 31 '11 at 14:51
  • Thanks..yes checking the permissions on both source and destination fixed the problem. – sam Nov 01 '11 at 11:28
  • @sam please add this as answer and mark it as solved – ccellar Nov 08 '11 at 18:34

1 Answers1

2

checking the permissions on both source and destination fixed the problem.

sam
  • 4,594
  • 12
  • 61
  • 111