Jump to content

Run scheduled robocopy task in command prompt window


Recommended Posts

I'm running this on a 2008 box, but it is applicable to Vista/7 as well, and this forum has better response, so I posted here.

I'm running a scheduled task everyday to copy my backups to offsite media. It's a robocopy batch script. It'd be nice to see the progress of the script rather than just seeing robocopy.exe running in task manager, so is there any way to get the scheduled task to start in a command prompt window? If so, how?



PS: I tried running "cmd.exe /K c:\mirror.bat", which seems to work fine when I run it from the Run menu or from the command prompt, but doesn't show the command prompt window when running a scheduled task. I'm running the scheduled task as the same user I'm logged in as.

Link to comment
Share on other sites

Under Vista/7, the scheduled tasks run as a service in session 0, which you by default cannot see. The only way to get a scheduled task that calls a cmd prompt to be visible is to make sure it is set to "only run when a user is logged on", and that user scheduled to run the task must actually be logged on when the task runs.

By default, processes running in session 0 (where services, the default desktop, etc) are running cannot put any display information into session 1+ (where users actually log on and view their desktops) for security reasons. This is a change from previous versions of Windows, where session 0 was shared between services/default desktop and the console user, who also logged into session 0. In Vista+, all interactive logons are actually session 1 or higher, just like a terminal server session.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...