I would guess that Z:\Job Logging\addToDb is not a valid directory.
Refer to the doc for File#listFiles():
Returns: An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
I would guess that the Windows 7 machine was set up to automatically map the Z drive a long time ago, and the new Windows 10 machine hasn't had that done yet.