Access citrix mapped local drive from scheduled task in Windows

0

My setup is Linux Mint as host OS, which logs in to a Windows 7 machine using through Citrix. My local (linux) home directory is visible on the Windows system as

\\Client\S$

What I want to do is make a (robo)copy of this folder to another Windows folder. My copy .bat script works when run by hand, but when run as a scheduled task I get (added a dir command for debugging)

dir \\Client\S$
The network path was not found.

Tried executing as myself as well as using SYSTEM. When I execute net use by hand I see:

\\Client\S$ PICAClientNetwork

net use from the bat script lists nothing. So my question is: how do I access this drive from my script?

Adversus

Posted 2015-12-07T14:04:54.967

Reputation: 103

Answers

2

The path \\client\s$ is mapped only in the user session context.

Running your script as any other user, or otherwise outside the user's session, means the path won't be reachable, and your script will fail.

Try and configure the task to run as the same user that is logged on to the Windows machine and select Run only when user is logged on. As far as I remember, that should cause the task to run in the user's session.

I'm not sure if Run with highest privileges will cause the script to run in a different session, but you can try it out if you need script to run elevated.

abstrask

Posted 2015-12-07T14:04:54.967

Reputation: 4 714

Thanks for the answer. The user is set correctly but I have not tried Run only when user is logged on and it sounds like that might be it. I'll try that (next week) and mark as answered if that was it. Was already planning to write something to trigger my .bat myself but I'd prefer not to go that route. – Adversus – 2015-12-11T09:50:46.510

1Checking Run only when user is logged on solved it, super! – Adversus – 2015-12-14T09:02:47.967