C++ Program Executables not Running from Scheduled Tasks

Posted on 2011-10-04
Last Modified: 2012-06-22
I have written a number of programs in C++ which take data from large text files and condense it into smaller files that can be uploaded to our website and used by local apps. These had been scheduled to run daily on a Windows 2003 server, and worked just fine as such. However, since we migrated to a Win 2008 Server, these programs refuse to run in task scheduler. They work if I execute them through win explorer or command line, but they either hang or return a 0x3 error from scheduled tasks. At first, I thought it had to do with the fact that the programs copy files from remote locations, but after I made everything local (the programs now only read & create files in their own directory), it still doesn't work.

I am running the tasks as an administrator, with highest privileges.

No idea what to do now.
Question by:rvfowler2
    LVL 13

    Accepted Solution

    Sounds more like a DEP issue or something to do with rights.

    Try This:
    To troubleshoot the first task you described, you may check the following settings.

    1.     Check if the task application runs under a path where log on user has the proper permission.  If not, you may add a command line like "CD c:\users\%username%\desktop" in front of the command line to start application.

    2.     Make sure the account to run task scheduler is in group "log on as batch job" rights (server side). Control Panel|Admin Tools|Local Security Policy\Local Policies\User Rights Assignments"Log on as a batch job"


    LVL 2

    Author Closing Comment

    Thanks! Turns out, the admin account didn't have permissions for the system32 dir. I didn't realize scheduled tasks started in this directory.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    I have been working as System Administrators since 2003. I recently started working as a FreeLancer and was amazed to find out that very few people are taking full advantage of their Windows Server Machines. Microsoft Windows Server comes with so…
    I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
    To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now