If you do not want to use Jenkins-plugins or schedule-Tasks, this is the "groovy" method:
Hand:
You can use the Groovy Script console provided by Jenkins> Manage Jenkins> Script Console and run the command to map a network drive in the Jenkins service. (Should be repeated as soon as the Jenkins service is stopped)
Automation:
Write your Groovy commands to a file named "init.groovy" and put it in your JENKINS_HOME directory. Thus, the network drive appears in Jenkins-startup.
Groovy Commands - Windows:
Check available network drives with Script-Console:
println "net use".execute().getText()
Your init.groovy will look like this:
def mapdrive = "net use z: \\\\YOUR_REMOTE_MACHINE\\SHARED_FOLDERNAME" mapdrive.execute()
source share