Guest cr9101 Posted December 5, 2007 Posted December 5, 2007 I've been having intermittent problems with my Task Scheduler program. I run several batch files each night that run Access database. Most of the time they run correctly. But not always. Some mornings when I come in I find that the scheduler still says a batch file is running, but neither Access nor the batch file appears to be running. If I cancel the scheduled task, I can then run it successfully. After doing some research on this message board (and it's been a big help on a lot of issues!), I see that I need to use the unc address instead of the mapped address. How do you come up with the unc address for the program (MSAccess.exe)? For example, here's what I had: rem write to log file echo report has started %Date% %Time% >> "d:\server1\Shared Documents\MSAccess\Scheduled\results.log" rem open TestFE.mdb using MSAccess "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "d:\Shared Documents\MSAccess\Scheduled\TestFE.mdb" /wrkgrp "d:\Shared Documents\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR Once I made the changes: rem write to log file echo report has started %Date% %Time% >> "\\server1\Shared\MSAccess\Scheduled\results.log" rem open TestFE.mdb using MSAccess "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "\\server1\Shared\MSAccess\Scheduled\TestFE.mdb" /wrkgrp "\\server1\Shared\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR This batch will write to the log, but hangs just like the first one did. I have a feeling I also need to use the unc address for the program, but I don't know how to find what it is. When I open \\server1, there is no 'Program Files' directory & I can't find it. Any help would be appreciated. Connie
Guest Brock Hensley Posted December 5, 2007 Posted December 5, 2007 Re: Task Scheduler / UNC address UNC Path would be something like \\remote_server\c$\Program Files\... remote_servername or IP c$ is the C drive's root "cr9101" <cr9101@discussions.microsoft.com> wrote in message news:606FCF41-CD24-496C-869A-D69A5844F263@microsoft.com... > I've been having intermittent problems with my Task Scheduler program. I > run > several batch files each night that run Access database. Most of the time > they run correctly. But not always. Some mornings when I come in I find > that > the scheduler still says a batch file is running, but neither Access nor > the > batch file appears to be running. If I cancel the scheduled task, I can > then > run it successfully. > > After doing some research on this message board (and it's been a big help > on > a lot of issues!), I see that I need to use the unc address instead of the > mapped address. How do you come up with the unc address for the program > (MSAccess.exe)? > > For example, here's what I had: > > rem write to log file > echo report has started %Date% %Time% >> "d:\server1\Shared > Documents\MSAccess\Scheduled\results.log" > > rem open TestFE.mdb using MSAccess > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "d:\Shared > Documents\MSAccess\Scheduled\TestFE.mdb" /wrkgrp "d:\Shared > Documents\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR > > Once I made the changes: > rem write to log file > echo report has started %Date% %Time% >> > "\\server1\Shared\MSAccess\Scheduled\results.log" > > rem open TestFE.mdb using MSAccess > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" > "\\server1\Shared\MSAccess\Scheduled\TestFE.mdb" /wrkgrp > "\\server1\Shared\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X > YestOR > > This batch will write to the log, but hangs just like the first one did. I > have a feeling I also need to use the unc address for the program, but I > don't know how to find what it is. When I open \\server1, there is no > 'Program Files' directory & I can't find it. > > Any help would be appreciated. > Connie >
Guest Pegasus \(MVP\) Posted December 5, 2007 Posted December 5, 2007 Re: Task Scheduler / UNC address "cr9101" <cr9101@discussions.microsoft.com> wrote in message news:606FCF41-CD24-496C-869A-D69A5844F263@microsoft.com... > I've been having intermittent problems with my Task Scheduler program. I > run > several batch files each night that run Access database. Most of the time > they run correctly. But not always. Some mornings when I come in I find > that > the scheduler still says a batch file is running, but neither Access nor > the > batch file appears to be running. If I cancel the scheduled task, I can > then > run it successfully. > > After doing some research on this message board (and it's been a big help > on > a lot of issues!), I see that I need to use the unc address instead of the > mapped address. How do you come up with the unc address for the program > (MSAccess.exe)? > > For example, here's what I had: > > rem write to log file > echo report has started %Date% %Time% >> "d:\server1\Shared > Documents\MSAccess\Scheduled\results.log" > > rem open TestFE.mdb using MSAccess > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "d:\Shared > Documents\MSAccess\Scheduled\TestFE.mdb" /wrkgrp "d:\Shared > Documents\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR > > Once I made the changes: > rem write to log file > echo report has started %Date% %Time% >> > "\\server1\Shared\MSAccess\Scheduled\results.log" > > rem open TestFE.mdb using MSAccess > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" > "\\server1\Shared\MSAccess\Scheduled\TestFE.mdb" /wrkgrp > "\\server1\Shared\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X > YestOR > > This batch will write to the log, but hangs just like the first one did. I > have a feeling I also need to use the unc address for the program, but I > don't know how to find what it is. When I open \\server1, there is no > 'Program Files' directory & I can't find it. > > Any help would be appreciated. > Connie > Whether you use Drive:Folder or UNC addresses is irrelevant. What counts is if the account used for the scheduled task has sufficient access to these resources. If you use the System account then it has no access at all to networked resources. Put some basic diagnostics into your batch file to clarifiy the issue, e.g. like so: #echo Report has started %Date% %Time% > c:\test.log #echo The user account is %UserName% >> c:\test.log #echo The following files are visible in "d:\Shared Documents\MSAccess\Scheduled" >> c:\test.log #dir "d:\Shared Documents\MSAccess\Scheduled\*.*" 1>> c:\test.log 2>>&1 #echo. >> c:\test.log #echo The following files are visible in \\server1\Shared\MSAccess\Scheduled >> c:\test.log #dir "\\server1\Shared\MSAccess\Scheduled\*.*" 1>> c:\test.log 2>>&1 Remove the # characters - they only serve to mark the start of each line.
Guest cr9101 Posted December 5, 2007 Posted December 5, 2007 Re: Task Scheduler / UNC address Thanks, Brock! That's what I needed! Connie "Brock Hensley" wrote: > UNC Path would be something like \\remote_server\c$\Program Files\... > > remote_servername or IP > > c$ is the C drive's root > > > "cr9101" <cr9101@discussions.microsoft.com> wrote in message > news:606FCF41-CD24-496C-869A-D69A5844F263@microsoft.com... > > I've been having intermittent problems with my Task Scheduler program. I > > run > > several batch files each night that run Access database. Most of the time > > they run correctly. But not always. Some mornings when I come in I find > > that > > the scheduler still says a batch file is running, but neither Access nor > > the > > batch file appears to be running. If I cancel the scheduled task, I can > > then > > run it successfully. > > > > After doing some research on this message board (and it's been a big help > > on > > a lot of issues!), I see that I need to use the unc address instead of the > > mapped address. How do you come up with the unc address for the program > > (MSAccess.exe)? > > > > For example, here's what I had: > > > > rem write to log file > > echo report has started %Date% %Time% >> "d:\server1\Shared > > Documents\MSAccess\Scheduled\results.log" > > > > rem open TestFE.mdb using MSAccess > > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "d:\Shared > > Documents\MSAccess\Scheduled\TestFE.mdb" /wrkgrp "d:\Shared > > Documents\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR > > > > Once I made the changes: > > rem write to log file > > echo report has started %Date% %Time% >> > > "\\server1\Shared\MSAccess\Scheduled\results.log" > > > > rem open TestFE.mdb using MSAccess > > "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" > > "\\server1\Shared\MSAccess\Scheduled\TestFE.mdb" /wrkgrp > > "\\server1\Shared\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X > > YestOR > > > > This batch will write to the log, but hangs just like the first one did. I > > have a feeling I also need to use the unc address for the program, but I > > don't know how to find what it is. When I open \\server1, there is no > > 'Program Files' directory & I can't find it. > > > > Any help would be appreciated. > > Connie > > > > >
Recommended Posts