Scheduled Task - States Task Ran - No Results

quick2steve

New Member
I have reviewed previous postings about similar issue. I am running with the highest privileges. I have a bat file that runs without errors on the command line. Uses robocopy to back up document directory. The scheduler history states it started, action completed with an error code 16 (don't know what this means) and task successfully completed? But I do not think it is actually executing the bat file.
 

My Computer

Just an ordinary error code of 16 decimal is "the directory could not be removed" if that's any help. A google on Windows Error Lookup Tool should find the freebie I'm using.

Whatever the batch file is it might work better if you implement it in AutoIt3 and compile it. To run external executables in AutoIt3 is very easy. It's free, and it has a forum full of programmers if you get stuck.
 

My Computer

System One

  • Manufacturer/Model
    HP Pavilion m9515y
    CPU
    Phenom X4 9850
    Memory
    8 GB
    Graphics Card(s)
    Some Radeon Cheapie with 512 MB Ram
    Monitor(s) Displays
    CRT
    Screen Resolution
    1280x1024
    Hard Drives
    750 GB SATA 3G
    2 SIIG Superspeed docks w/WD Caviar Black Sata II or III
C:\>net helpmsg 16
The directory cannot be removed.

C:\>


Works on all machines. No need for "formatter" utilities.
 

My Computer

C:\>net helpmsg 16
The directory cannot be removed.

C:\>


Works on all machines. No need for "formatter" utilities.

Then again, neither method handles HRESULT error codes.
Mine does






free for personal use at your own risk. :)
 

My Computer

System One

  • Manufacturer/Model
    HP Pavilion m9515y
    CPU
    Phenom X4 9850
    Memory
    8 GB
    Graphics Card(s)
    Some Radeon Cheapie with 512 MB Ram
    Monitor(s) Displays
    CRT
    Screen Resolution
    1280x1024
    Hard Drives
    750 GB SATA 3G
    2 SIIG Superspeed docks w/WD Caviar Black Sata II or III
Thanks to all! I found an error in the script which I ran multiple times on the command line. However I do have another problem. The script copies my a directory to a network drive. Works OK, however, the top directory I created on the NAS does not show up, only the second level. However, when I delete the content under the top directory I created it shows backup up. Any idea why this is happening?

@ECHO OFF
set d=R:
rem
rem map network drive
net use %d% /d /y
rem
rem map network drive
net use %d% "\\RND4250\hp-dv71245dx\Daily Backups"
rem
rem generate directory name
set h=%time:~0,2%
IF %time:~0,2% LSS 10 (set h=0%time:~1,1%)
set m=%time:~3,2%
set dirname=%date:~10,4%-%date:~4,2%-%date:~7,2%
rem
rem change drive & directory
%d%
rem
rem create directory
IF EXIST %dirname% (Set dirname=%dirname%-%h%%m%)
mkdir %dirname%
rem
rem generate robocopy command
set from=C:\Users\Steve\Documents
set to=%d%\%dirname%
robocopy "%from%" "%to%" /E /COPY:DAT /R:10 /Z /XJD /log:%d%\RoboCopyLog.txt
rem
rem unmap network drive
net use %d% /d /y
exit
 

My Computer

Back
Top