Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Issue in batch file execution in Windows 2008 server  (Read 12825 times)

0 Members and 2 Guests are viewing this topic.

pvignesh92

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Unknown
    Issue in batch file execution in Windows 2008 server
    « on: July 25, 2012, 09:14:05 PM »
    Hello guys,

    Need your expert advice in this. I have been facing issue in a cmd file. I was executing some set of command in a batch file. I want the second command execute after the first command completes.

    My scenario

    1st cmd :start tdpexcc - will execute the backup of an exchange DB ( backup ll run at the background)

    2nd cmd : tail - 20 output of backup completion status to another file

    What happens is the second cmd executes even before the process started by first command completes. Kindly help me in resolving this

    Thanks

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Issue in batch file execution in Windows 2008 server
    « Reply #1 on: July 26, 2012, 06:20:27 AM »
    I'd add a delay in between both instructions using SLEEP. I haven't tested SLEEP on Server 2008 but it worked on 2000 and 2003 servers when added.

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Issue in batch file execution in Windows 2008 server
    « Reply #2 on: July 26, 2012, 08:39:35 AM »
    Because you are using the START command without the WAIT option.  But even then some programs don't obey the wait option.  So just execute the first command without the START command.

    c:\path\tdpexcc.exe
    Tail.exe -20 logfile.log