The system cannot find the file specified- Task Scheduler. Win Server 2012

41

Finally I was able to resolve the issue. The problem was with the user authority. The batch script was suppose to encrypt a file and then ftp the encrypted file to the vendor's ftp server.

Apparently in Windows Server 2012 , the ADMINISTRATORS have the permission to create a file (here the encrypted file) while this user does not have the permission to send it. and SYSTEM user has the permission to send but not to create. (Both of them had this authority back in Win Server 2008).

hence what did I do at the end, was to make two different batch script tasks and schedule them with 10 mins time distance. The first one was running the above code with ADMINISTRATOR privileges and the second one was sending it out with SYSTEMS.

Share:
41

Related videos on Youtube

Mark McWiggins
Author by

Mark McWiggins

Updated on September 18, 2022

Comments

  • Mark McWiggins
    Mark McWiggins over 1 year

    I just put in a Dockerfile for some Python code I need to get into GKE.

     % ls
    README.md       app_DEV.yaml        app_PROD.yaml       db.py           main.py         requirements.txt
    

    I went through a couple of cycles of docker build before I got it done.

    Then docker suggested a docker scan to look for vulnerabilities I tried it but left off the . after the command, which left me with an extra ~ home directory down in the hierarchy where I don't want it:

    % ls
    Dockerfile      README.md       app_DEV.yaml        app_PROD.yaml       db.py           main.py         requirements.txt    ~
    

    What's the safest way to remove this? Python removing this directory entry? I don't want to goof and wipe my entire home directory.

    Thanks for any suggestions!

    • yagmoth555
      yagmoth555 about 9 years
      please put the path to gpg2, like c:\path\to\it\gpg2.exe
    • user 12321
      user 12321 about 9 years
      sure, will let you know the results in a min
    • user 12321
      user 12321 about 9 years
      @yagmoth555 still the same error :(
    • yagmoth555
      yagmoth555 about 9 years
      where it's stored ? can you like place the .exe in the c:\test in exemple ? I wonder if the account the task run under got access there
    • JosefZ
      JosefZ about 9 years
      1. Add echo CD=%CD% to the top of your script and pause to the bottom; 2. Run the script from command line or double click: error? 3. Run the script from Task Scheduler. 4. Compare echo CD=%CD% output...
    • user 12321
      user 12321 about 9 years
      @yagmoth555 it's in c:\apps\GnuPG , it should have access, as this task was working in our old server 2008. I will move it to C:\ and will let u know the results in a minute
    • user 12321
      user 12321 about 9 years
      @JosefZ I added echo CD=%CD% but it seems that my task is not stop running having this in the script file.
    • yagmoth555
      yagmoth555 about 9 years
      it seem to have found the .exe. the task is put to run elevated with all privilege ?
    • user 12321
      user 12321 about 9 years
      @yagmoth555 Yes it is with al privileges