Exec task is throwing exception "process 'Command' finished with non-zero exit value 1

I am working on a very complex project in which I have to install an in-house application on a Jenkins slave machine. Here is the code
task installBesOnUos1(type: Exec) {
description "Execute XYZ setup.exe file Unit of Scale 1 and deploy database to $databaseVM"
executable = "\\cpt-op-01-uos1.cpt-op.perf.sw.xyz.net\C$\XYZ_Installer\Setup.exe"
args = [’–script’, ‘–properties’, ““db.host1=cpt-op-01-db1.cpt-op.perf.sw.xyz.net,db.instance=,db.name=buds,db.authentication.type=USER,db.user=sa,db.pass=shock””, ‘–showlog’, ‘–iAcceptBESEULA’]
standardOutput = new ByteArrayOutputStream()
ext.output = { standardOutput.toString() }

So, I have an executable XYZ.exe on remote machine and this file need some arguments that I am passing in ‘args’ as an list of string.

But when I execute this task it throws an exception stating:
Caused by: org.gradle.process.internal.ExecException: Process ‘command’ ‘\cpt-op-01-uos1.cpt-op.perf.sw.xyz.net\C$\XYZ_Installer\Setp.exe’’ finished with non-zero exit value 1

I am struggling with this problem since yesterday and interesting thing is that I can install the same application on my local machine without any trouble. Something happens when I put a UNC path in it.

Please help.