Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94

    Windows Server 2003 - Scheduled tasks won't execute when logged out

    We have a Windows Server 2003 that we're using as a terminal server (remote desktop connection). A couple of people connect locally and from home through the remote desktop connection. I do.



    I am trying to set up Scheduled tasks. We've tried everything we can think of... using my user code/authorization, or having the Administrator use his user code/authorization. They may execute once, but if the remote desktop is closed, the scheduled tasks set to go off in the middle of the night, fail. We've been looking at the log. We get errors like:
    "The system cannot find the file specified. Try using the Task page Browse button to locate the application."
    "The system cannot find the path specified. Verify that the directory exists and try again."
    I've set up numerous tests, the jobs are suppose to kick of Microsoft Access. The scheduled task seems to be set up correctly, because when I right click on the job, the first time it will "Run". Sometimes you come back to this job the next day, and "run" does nothing.
    My MS Access database, if it runs, stores a date/time stamp in a table, so I have an absolute way of knowing whether the scheduled task runs.

    There is this checkbox "Run only if logged in", this seems to be meaningless.

    I'd love to get some ideas on how to make it work!

    Thank you in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I use a Windows Scheduled Tasks item set up on my pc that runs a VBScript file. Code in the VBScript opens an Access db. Code behind a form that opens by default runs a process to create a db file, extract data into that db, zip the db, create email object, attach the zip file, send email, delete zip and db.

    What do you want your scheduled task to accomplish?

    Is your 'task' in Windows Scheduled Tasks utility or are you coding something entirely in Access VBA?

    What is a 'job' and what options do you get when you right click on it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    “What do you want your scheduled task to accomplish?”


    I want it to open a MS Access database in a specific directory. The database will take it from there.

    “Is your 'task' in Windows Scheduled Tasks utility or are you coding something entirely in Access VBA?”


    The Windows Scheduled Task is created with the setup wizard in the Scheduled Tasks. I just drill down and select the Access database I want to run/open. The database, when opened, opens a startup form, and the start up form has VBA event procedures to run and eventually close.


    “What is a 'job' and what options do you get when you right click on it?”


    By jobs I meant a scheduled task. If you right click on a scheduled task, you get ‘ Run, Cut, Copy, Delete, Rename, and Properties.’

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I never could get Scheduled Tasks to open specific database. So I went with the VBScript.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    June, somewhere else I saw examples of script to kick off a scheduled task... I think we're trying this next.

    I had it running 2 years just fine, it was opening the DB. Then, a new network person made changes to the live scheduled task rather than setting up a test task... and ever since, none of them are working and I haven't been able to get it to work the way it use to.

    Thanks!

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Here is my script code. The Scheduled Tasks utility executes the script like a program or bat file. The file name is OpenDB.vbs

    ' ProcessKillLocal.vbs
    ' Sample VBScript to kill a program
    ' Author Guy Thomas http://computerperformance.co.uk/
    ' Version 2.7 - December 2010
    ' ------------------------ -------------------------------'
    Option Explicit
    Dim objWMIService, objProcess, colProcess
    Dim strComputer, strProcessKill
    strComputer = "."
    strProcessKill = "'msaccess.exe'"
    If (Month(Date()) >= 6 And Month(Date()) <= 9) Or ((Month(Date()) <= 5 Or Month(Date()) >= 10) And Day(Date()) < 8) Then

    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcessKill )
    For Each objProcess in colProcess
    objProcess.Terminate()
    Next
    'WSCript.Echo "Just killed process " & strProcessKill & " on " & strComputer
    'WScript.Quit
    'End of WMI Example of a Kill Process

    Dim objFSO, oShell
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'open the Access file
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run """C:\Program Files\Microsoft Office\Office12\msaccess.exe"" ""your file path"""
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I don't know that I have a solution but I am interested to know why this is a problem for you. I usually have RDP disabled so I have know first hand experience with your symptom.

    It seems you need your app to launch autonomously, while nobody is logged on. Is the only problem that the scheduler won't respond to your requests via .RDP? Are you disabling the scheduler and then Running it as needed?

  8. #8
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    “I don't know that I have a solution but I am interested to know why this is a problem for you. I usually have RDP disabled so I have know first hand experience with your symptom.”
    Disabled? Shoot, we use Remote Desktop connections from various places… like working from home, or working from the shopping mall when I tether in. It’s just like having “Go-to-My-PC”.



    “It seems you need your app to launch autonomously, while nobody is logged on. Is the only problem that the scheduler won't respond to your requests via .RDP? Are you disabling the scheduler and then Running it as needed?”
    Yes, I need the application to launch a bunch of times during a 24 hour day. They are update processes, like batch processing, to bring data into an Access database through an ODBC link to an SQL database.


    The problem is, during the 16 hours of the day where I’m not active through remote desktop, either logged out or closed without a log out, laptop disconnected and 15 miles away… the Windows 2003 terminal server is failing to run the scheduled tasks… giving the errors I reported earlier in my post.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Based on the symptoms and the error log, I would start with security permissions. It really does seem like this could be a very complex matter to sort through. Not likely you will be able to get detailed guidance over a forum.

    You may be able to narrow the focus by trying a couple things. You could create another Task that does something in a trusted folder known to terminal services. This may help you to find a place to put a batch file to launch the Access.

    I may not be saying it correctly because I am not a security professional. If I recall correctly around the time SP1 came out there were lots of changes to how security permissions and group policy was managed. It seems changes were made and Microsoft offered things like the Security Configuration Wizard to help manage this. It would seem Microsoft was trying to encourage IT to use security templates to help avoid issues with normal windows updates.

    Don't know if this info helps. I am not sure what you have tried so far. Executing a system batch file may offer an easy way around creating a large Group Policy thing to include your DB.

  10. #10
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    I'm making progress. I'm using this simple DOS based Script file, and two executed last night. I still need to test logging off the terminal server at night, will do this weekend.
    Here's the code in a file named ScriptForAccess.cmd) -----------------------------
    @echo off
    net use F: \\ME-SERVER\DatabasePath
    "D:\Program Files\Microsoft Office\Office12\MSAccess.exe" "F:\AccessDBfolder\AccessProgram.accdb"

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Thanks for the info. Let us know what happens when logged off.

  12. #12
    KathyL is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    Not good news.
    When I logged out for the weekend, none of the jobs ran. When I came into the office, and tried to 'run' the scheduled tasks, none of them would run. When I went into properties for the scheduled task, and re-keyed in my password, then they would run when I right-clicked 'run'.
    Error code:
    "ScriptForAccess script 1 00 AM.job" (ScriptForAccess.cmd) 10/6/2013 1:00:00 AM ** ERROR **
    The attempt to log on to the account associated with the task failed, therefore, the task did not run.
    The specific error is:
    0x80070569: Logon failure: the user has not been granted the requested logon type at this computer.
    Verify that the task's Run-as name and password are valid and try again.
    Someone new to handling our network, and I, are attempting to try some network security settings. Time will tell.

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    It is puzzling why it works sometimes and not others.

    Maybe there is something you can do with user rights for the RDP client that is logging on. Maybe you can look into the advanced properties and also make sure the admin rights for the user are applied correctly (Admin Group Assignment)
    User Manager for Domains > Policies > User Rights > Show advanced and then review what is there maybe (Batch Job)

    You might be able to get the file itself to run as Admin. I found this in support
    http://support.microsoft.com/kb/867466/en-us

    Make sure you review and understand all of the procedures and the consequences. This is just FYI. Stuff I found on the net and me not really understanding what is going wrong over there. Nothing more than food for thought here.....

  14. #14
    KathyL is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    Progress has been slow. Tons of testing. It is Security related, and our network guy is adding my security level to .cmd files and checking Domain policies. One thing I know for sure, is if I'm off site and logged out, both a .accdb scheduled task or a .cmd windows script, would fail. In our error logs, the .accdb scheduled task says it's an invalid path, so logging out kills a known path. And putting a mapping in the .cmd script file, at least tells it where to map a folder.

    Last thing we just did, is add, in the properties of the scheduled task, under Security, is my User name with full control. (it's not set up by default) I've tested live by disconnecting my LAN cable, which would be like I had left the building with my laptop.... and, hurrah, they ran. Tonight will be the final big test, LOL.

  15. #15
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Fingers crossed.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access 2002 Runtime on Windows Server 2008
    By kingcarol in forum Access
    Replies: 0
    Last Post: 08-23-2012, 06:56 AM
  2. Replies: 3
    Last Post: 06-18-2012, 02:04 PM
  3. Sending email on windows server 2008
    By Randy in forum Access
    Replies: 0
    Last Post: 03-20-2012, 08:35 AM
  4. Replies: 3
    Last Post: 07-15-2010, 05:53 PM
  5. Access 2003 and Windows 7
    By icedude in forum Access
    Replies: 4
    Last Post: 02-03-2010, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums