This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

My question is: Why does 1-monday.bat run perfectly by clipping a shortcut and produce a 410 error when Windows runs it in the task scheduler?

Hello. The file 1-lunes.bat contains the instructions to make a backup and run a program as shown below:

CD D:\catalina-gas\inventar

runcobol.exe averaver.cob c=windows.cfg L=WOWRT.DLL

CD D:\catalina-gas\creditos

runcobol.exe solito.cob c=windows.cfg L=WOWRT.DLL

CD D:\catalina-gas\pagar

runcobol.exe solito.cob c=windows.cfg L=WOWRT.DLL

RMDIR /S  /Q f:\backup\catalina-gas\lunes

XCOPY /E /I /Y D:\catalina-gas f:\backup\catalina-gas\lunes

 

1-monday.bat runs perfectly when it receives a direct clip to the shortcut on the Desktop but if it is placed as a Windows task in task scheduler program script D:\catalina-gas\backup\1-monday.bat the program AVERAVER.COB produces an error: Cobol configuration 410 error processing configuration

 

My question is: Why does 1-monday.bat run perfectly by clipping a shortcut and produce a 410 error when Windows runs it in the task scheduler?

  • Suggested Answer

    0

    What directory contains windows.cfg?  

    My guess is that in your desktop shortcut, somehow the RUNCOBOL environment variable contains the directory in which windows.cfg is located. 

    Perhaps the task scheduler is running as a different user, and the RUNCOBOL environment variable is not initialized to the expected value(s).

  • 0 in reply to 

    D:\catalina-gas\backup

  • 0 in reply to 

    Volume in drive D is Misprogramas

     Volume Serial Number is 80F4-A930

     

     Directory of D:\catalina-gas\backup

     

    [.]                 [..]                1-lunes.bat         2-martes.bat

    3-miercoles.bat     4-jueves.bat        5-viernes.bat       6-sabado.bat

    7-domingo.bat       Backup-Diario.lnk   BACKUPWG.COB        BACKUPWG.wow

    confirmar_0.bmp     domingo_0.bmp       folder.doc          jueves_0.bmp

    logfont.cpy         lunes_0.bmp         martes_0.bmp        miercoles_0.bmp

    regresar_0.bmp      sabado_0.bmp        viernes_0.bmp       windows.CFG

    windows.cpy        

  • 0 in reply to 

    The windows.cfg, the file is in every folder where any program is executed

  • 0 in reply to 

    Does windows.CFG have adequate permissions for the user being used by the task scheduler?

    I think I would add dir *.* >debug.txt into the BAT before each runcobol.  This might help???

  • 0 in reply to 

    Sorry Tom, still giving the same error.

  • 0 in reply to 

    Ok, Wascar.

    Error 410 is very specific - the configuration file cannot be found.

    The C command line option uses a pathname.  One thing you could try is to specify a non-relative pathname.  Your current C=windows.cfg would seem to need the configuration file in each of the current directories.  (I looked at User's Guide.  My assumption that the RUNCOBOL environment variable would be involved, but I cannot find this documented.)

    Other than simply not being in a directory, the next most likely cause would be that the file exists, but does not have read permission for the user.  (If this were Unix/Linux, upper and lower case make a difference, but this is Windows where case is ignored.)

  • 0 in reply to 

    Did you ever solve this issue?

  • 0 in reply to 

    Hello, I did everything you told me but nothing works. I have decided not to continue with this because I cannot find solutions.

  • 0 in reply to 

    I have emailed you a test script to help diagnose the problem.  Sorry for going to email, but I see no way to attach a file to this post.