Scheduled Task history indicates task completed successfully but....


  1. Posts : 14
    Various - W7 32bit, 64bit
       #1

    Scheduled Task history indicates task completed successfully but....


    Hi,

    New here. I'm using a Scheduled Task to fire a very simple bat file that pulls, compresses and pushes a set of files to a different network directory. The bat file runs fine manually. On a networked desktop I have set up the task to run at about 5am est (waking the machine), as highest authority, when connected to the network, even when user is logged off and such. The task history tab shows 'Action complete' and 'Task complete' as anticipated but there are no new files (or the log that is created) as expected. I've verified the paths in the bat file. I'm confused about the "history" interpretation.

    If the task/action complete successfully - what exactly does that mean?! As I mentioned - I can run the file manually with success - the files are completed and exist. It seems when the machine is logged off and asleep - it will wake up, run 'something' and show success.

    Any suggestions to help trouble shoot are greatly appreciated. I wanted to run the task 'at logoff' but seems that is not readily available due to possible corruption/hanging and preventing that type of trigger from happening. Logon may become my option next - I just didn't want to stress the network in anyway if everyone is at once - but it is actually a very small office of users.

    Sorry for the long post.

    John
      My Computer


  2. Posts : 14
    Various - W7 32bit, 64bit
    Thread Starter
       #2

    Just an update - I can run this bat file manually but the file will NOT run automatically - even IF the PC is powered up It is set to run at the highest authority, wake if asleep and connected to the network. I hope someone has some ideas - I'm about at a loss. All forum searching I already have covered. Thanks in advance.

    P.S. Is there a thread to this I can read responses? Someone responded to me and I received an email - but when logging in I only see my single question here....just curious.
      My Computer


  3. Posts : 6,285
    Windows 10 Pro X64
       #3

    What account do you have it set to run under?

    Export the task then post here so we can look at it.

    Right click on it and select Export. It will be saved as a .xml file. Copy and paste it's content here or zip and attach here.
      My Computer


  4. Posts : 14
    Various - W7 32bit, 64bit
    Thread Starter
       #4

    Hi Ztruker - thank you for the offer of assistance.

    I have it set to run with the highest authority - all users configured for the desktop are under the Administrators group on the machine as well. I am attaching the xml export of the job. I appreciate any suggestions. I'd rather have this wake and run the bat file when users are not in the office as opposed to after login to avoid complaints about the DOS screen popup - OR them opening outlook before it's backed up (one of the backups in the bat job) If that's what I have to manage then I will have to manage it.....thanks!
    Scheduled Task history indicates task completed successfully but.... Attached Files
      My Computer


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    That looks okay to me. Can you post the content f the bat file please?
      My Computer


  6. Posts : 14
    Various - W7 32bit, 64bit
    Thread Starter
       #6

    Hi Ztrucker - here is the bat file contents....very simple - probably a more efficient way to do this but it seems to work for my need - and I'm just a hack anyway!

    Thanks for looking at it - it runs manually and I'm just taking some outlook files and the contents of a single folder and moving it from the local desktop over to a shared folder on our server "U:/" . Each desktop connects to the logged in users's shared folder on our network - so U:/ is all I need for the path - works great when run manually, as I mentioned. And this will run 'at logon' as well - it's just the waking up of the desktop that I can't seem to get to work for me.

    Here is the file contents:

    (btw - I have some 'renaming' activities that I use on a laptop that I have set to run at login - but on this desktop version of the bat I've commented out the renaming/deletion and changed the file it creates with a prefix of "DT14" to differentiate a test case as I'm testing with my laptop and on a desktop I log into and didn't want to hose my laptop's version of the backup (working great but at login to the network for me) of outlook and other files.....didn't want to confuse you with diff names/details etc.)



    ::Create the Log file of bat file execution
    ::
    ::
    Echo >U:\BackupLog.txt


    :: Outlook file compression and backup
    ::
    ::
    for %%A in (C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook) do "C:\Program Files\7-Zip\7z.exe" a -tzip -mx5 "U:\outlooknewDT14.zip" -xr!*.bat "C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook">>U:\BackupLog.txt
    ::REN "U:\outlook.zip" "outlookold.zip"
    REN "U:\outlooknewDT14.zip" "%USERNAME%outlook.zip"
    DEL "U:\outlooknew.zip"
    DEL "U:\outlookold.zip"



    ::User file compression and backup
    ::
    ::
    for %%A in (C:\Users\%USERNAME%\Documents\Vitusa) do "C:\Program Files\7-Zip\7z.exe" a -tzip -mx5 "U:\VitusanewDT14.zip" -xr!*.bat "C:\Users\%USERNAME%\Documents\Vitusa">>U:\BackupLog.txt
    ::REN "U:\Vitusa.zip" "Vitusaold.zip"
    REN "U:\VitusanewDT14.zip" "%USERNAME%Vitusa.zip"
    DEL "U:\Vitusanew.zip"
    DEL "U:\Vitusaold.zip"

    Thanks,

    John
      My Computer


  7. Posts : 6,285
    Windows 10 Pro X64
       #7

    That's pretty straight forward. Try this.

    Change the command to cmd /k C:\BackupDT14.bat

    That should open the batch file in a Command Prompt window and leave it open. Maybe you can spot what is going wrong then????
      My Computer


  8. Posts : 14
    Various - W7 32bit, 64bit
    Thread Starter
       #8

    thanks - I'll have to try it tomorrow in a forced test (logged off) to see - problem is that it's simply not running. Or should I say not waking the computer - so I'd expect this will open and leave open IF it is opening! thanks - will see what happens and post either way.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:15.
Find Us