Scheduled .bat file no longer opening a cmd window RRS feed

  • Question

  • O/S:  Windows 7 Pro 32-bit.

    I have a batch file that I've scheduled to run every Sunday morning at 6:00am.  The bat file contains a bunch of directory-handling and xcopy commands to copy a series of files to a hot-swappable disk drive.  It displays a command prompt window on the screen as it runs - just as I want it to.  Sometime after the bat file has completed, I use the HotSwap! app to release the disk from the O/S before powering the drive down and removing the drive.

    This has worked flawlessly for about two years.  However, last weekend I went into Task Scheduler and merely changed the job's scheduled start time from 6:00am to 6:30am and saved my changes.

    Now, when the job runs, the command prompt window no longer shows, but I can see the task running in task manager if I show all tasks.  And, when the job completes, I can no longer release the drive using HotSwap! - it reports that a program has one or more files on it in use.  I have to power the system all the way down in order to remove the drive.

    I had something like this happen a long time ago and I remember that I had to do something at the command prompt with schtasks and I remember it was quite painful to get it working correctly again, but I can't remember what I did. 

    I looked at the parameters of the scheduled task with "schtasks /query /v" but I can't see anything amiss.  The task acts as if it is running under SYSTEM but the "run as user" parameter shows the correct user account.

    How can I get the command prompt window back and regain control over the drive?


    Wednesday, May 1, 2013 1:53 AM

All replies

  • Hi,

    Have you tried the system restore? You may go back the system to a previous status and see if this can help.


    Tracy Cai
    TechNet Community Support

    Thursday, May 2, 2013 6:22 AM
  • Hi Tracy,

    Thanks, but that's not an option at this point. This computer is used as a server and there have been too many changes to the computer that I don't want to roll back, and also don't want to risk any complications or problems resulting from a system restore.  I've had weird issues arise in the past after using system restore, like inconsistent software states.  I would only use system restore in an emergency if I didn't have a very recent image to restore.

    Anyway, even if I did roll back, I would probably still be faced with the problem arising again after changing the scheduled time unless I can identify what caused the problem to begin with.

    Friday, May 3, 2013 1:25 AM