I've written a program that should run every day at a fixed time. When I was first putting it together I had problems reaching a mapped network drive. The solution was to use the UNC path instead of the mapped drive letter. This ran under Task Manager in production just fine for over a month, but this week I started getting an error about the drive not being available.
When I run the script from the cmd-line it runs fine, but when I run it manually from the Task Scheduler the drive is not visible.
Here's the task settings that seem relevant or have been brought up in other posts:
- user: running as admin user that has full access
- "Run whether user is logged in or not": CHECKED
- "Do not store password...": NOT CHECKED
- "Run with highest priviledges": CHECKED
- "Configure for": "Windows Vista or Windows Server 2008"
I've created a most minimal test program that runs with the same results: runs fine from cmd-line, fails to see drive when run from Task Manager.
require 'pp'
# I removed our IP address, but it was there in my tests
path = '\\\\NNN.NNN.NNN.NNN\\external data\\download'
File.open'test_out.txt', 'a' do |file|
file.puts '---running test at: ' + Time.now.to_s
file.puts '---dir listing of current (local) dir:'
file.puts Dir.entries('.')
file.puts '---dir listing of a network dir:'
file.puts Dir.entries(path)
end
I've inquired to our IT dept about any changes they've made that might be related and they got nothing.
Any help would be appreciated