Jenkin Jobs are failing because it is not able to access the mapped n/w drive

Hi

please help to resolve the following issue .

  • hosts:
    become_user:
    become_method: runas
    tasks:
  • name: to start bat file
    win_scheduled_task:
    name: task name here
    username: <domain\user>
    password:
    actions:
  • path: cmd.exe
    arguments: /c cd /d D:\CI & start.bat
    triggers:
  • type: boot
    logon_type: password

with this i am able to start the batfile to connect jnlp in jenkins. and the bat file runs in background in the remote machine.
problem is when i run the jenkins job it is fails to access the mapped network drive .
i am not able find the solution foe this pls do suggest the solution .
Some inform i got as since the bat is running in background it will not have the access to the network is tat so??

You won’t be able to access a mapped drive within an Ansible task or any other non-interactive logons in Windows. There is a fundamental security barrier between how WinRM processes or scheduled task jobs are started and where mapped drives are accessible to the user.

Thanks

Jordan