Post Batch Command NOT Working

Discussion in 'Acronis True Image Product Line' started by whitedavidp, Apr 22, 2007.

Thread Status:
Not open for further replies.
  1. whitedavidp

    whitedavidp Registered Member

    Joined:
    Mar 28, 2007
    Posts:
    55
    I want to run the following, simple batch post backup command concurrently with TI 10 Home. I have a backup location defined in TI 10 at D:\AcronisOutlookBackup and the drive F: is a USB memory stick/thumb drive. I place this batch file in C:\Acronis\Addons\CopyToThumbDrive.bat.

    As I am defining my backup task in TI 10, I select the batch file for the post command. I then press the Test Command button. A DOS box window (this is on XP) opens but nothing happens. The window title does NOT show the batch file's path.

    I have also tried to spawn the batch file using the command cmd.exe with /c C:\Acronis\Addons\CopyToThumbDrive.bat as the argument. I get a different result but the batch file still does not execute as expected.

    What's happening here? Thanks.


    @echo off

    :validate
    rem Ensure that thumb drive exists
    if not exist F:\nul goto error

    :sleep
    rem Wait for a period of 10 minutes (hack'ed sleep command)
    ping 127.0.0.1 -n 600 -w 1000 > nul

    rem Ensure that there is a properly named directory on that thumb drive
    if not exist F:\AcronisOutlookBackup\nul mkdir F:\AcronisOutlookBackup

    rem Clear anything that may be in that directory at this time
    if exist F:\AcronisOutlookBackup\*.* del /Q F:\AcronisOutlookBackup\*.*

    rem Copy the contents of the Acronis backup location on D: to the
    rem thumb drive
    copy /V D:\AcronisOutlookBackup\*.tib F:\AcronisOutlookBackup

    :done
    goto exit

    rem Show error message
    :error
    echo Thumb drive F: does not exist. Please insert it now.
    pause

    rem If the thumb drive now exists, continue processing
    if exist F:\nul goto sleep

    rem If not, show final error message and quit
    echo Thumb drive F: still does not exist. Aborting transfer to thumb drive
    pause

    :exit
    exit
     
  2. Guy Scharf

    Guy Scharf Registered Member

    Joined:
    Sep 3, 2006
    Posts:
    11
    Try making a CMD file instead of a BAT file; that worked for me. I.e., call your command file CopyToThumbDrive.cmd. In the post command entry field, include the fully qualified path to the CMD file.

    Guy
     
  3. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello whitedavidp,

    Thank you for choosing Acronis Disk Backup Software.

    Please notice, as explained in chapter 5.3.3 "Pre/post commands" of the User's Guide:
    Thank you.
    --
    Marat Setdikov
     
  4. whitedavidp

    whitedavidp Registered Member

    Joined:
    Mar 28, 2007
    Posts:
    55
    I see that now. As a Windows programmer, I would be interested in knowing why this is not supported. Can you tell me why? Thanks.
     
  5. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello whitedavidp,

    Because Acronis True Image executes tasks (and pre\post commands as a part of these tasks) in a special Windows environment (special shell), which is not visible to the user, and cannot receive user input.

    We are sorry we cannot provide you with more detailed information due to secure reasons.

    Thank you.
    --
    Aleksandr Isakov
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.