Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scheduling a .BAT script has me confused (XP Home)

    <img src=/S/confused.gif border=0 alt=confused width=15 height=20> I've created a backup batch file, called "backuplog.bat" which runs fine from the command prompt.
    I've attempted to schedule it using the task scheduler and set everything I can think off

    The SCHED.LOG file reports that it started, and then that it has completed with the following messages
    "Backup.job" (Backuplog.bat)
    Started 2/06/2003 8:26:23 a.m.
    "Backup.job" (Backuplog.bat)
    Finished 2/06/2003 8:26:23 a.m.
    Result: The task completed with an exit code of (80).

    Sadly, there is no evidence that the job has run - my first line is an "ECHO started on DATE > F:BackupJunk.txt" which does not appear.

    What am I doing wrong? Or, alternatively, where is there a good source of documentation.
    Info that may or may not be relevant
    I have set a valid user account with password,
    I have set a start directory "F:Backup"
    I have quoted the batch file as a fully qualified name "F:BackupBackuplog.bat"
    I have preceded it with "cmd /Q /C " on occasions with no better results

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Try including an output file for the batch commands in the scheduler command. as in this screen shot. Then then look in the log file.

    StuartR

  3. #3
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,580
    Thanks
    5
    Thanked 1,058 Times in 927 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Andrew, Scheduled tasks require a user and password. The password can not be blank. Did you do that?

    Joe
    Joe

  4. #4
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Stuart & Joe - thanks for your time and suggestions.

    I think I'm on the track now - although perhaps someone can read this and shed some more light.

    My own account has NO password. I therefore created an account called "Backup" that had one and scheduled the jobs with that particular usercode.

    The result is - if I am logged on as Backup when I try to run the job it runs fine. If I am logged on as me - it fails silently (no output even from Stuart's suggestion).
    It also wants to display things (like the command window and NTBackup output) on the screen.

    Naturally, this is not quite what I had hoped for. My workaround is to give my own account a password, use that account as the batch job's user, and simply put up with the unwanted screen display - at least backups will happen <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  5. #5
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Tim

    That clears it all up <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> - I'll just run it as me and live with it <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I appreciate the time and expertise from everybody - its great to get help when all other avenues have closed.

  6. #6
    Star Lounger
    Join Date
    Feb 2001
    Location
    Pennsylvania
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Stuart,
    When I try to use my Scheduled Task program and I enter all the proper info PWs, my account and what task I get an error message that states Object Already Exist 0x800900F Then when I click on ok I get another message that states General Page Initializtion Failed program may not run. Do you have any idea what in the world is going on with my Scheduled Task program? I've just been ignoring it and running all my stuff manually. On another note and maybe this will help give you more info..... when you do the cleanmgr /sageset to set the files you want cleanup mgr. to clean on your disk it won't show me ALL the files when it list the default window for the C: drive. However if I type cleanmgr /sageset:99 or some number at the end that doesn't indicate the C: drive it does show me all the files. Any ideas what is going on here? <sigh?> Like I said this has been so frustrating I've just been ignoring it and cleaning my disk manaully as well as doing my Task manaully.

    I'd really appreaciate any input from anybody if anybody's ever heard of such craziness. I hope I'm not upsetting anyone with all my beginner type questions, but when things don't follow the common sense base line I get lost really quick. Thank you or anyone else that can point me in the right direction.

    Regards,
    JeffT

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Jeff,

    Sorry, I haven't come across either of these before.

    You may get more responses if you post your question as a completely new thread, with a relevant title, rather than as a response to this one.

    StuartR

    I just remembered
    I have seen a very similar problem with Task Manager when a computer had some jobs scheduled to run under a Domain account and was then removed from the domain to become a standalone PC in a workgroup.

    StuartR

  8. #8
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,580
    Thanks
    5
    Thanked 1,058 Times in 927 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    Tim, According to Xp's Help & Support the user does not have to be logged in. The run will still run. There is a batch type queue that each user automatically is allowed. This can be modified by a security policy. If you do a search on 'scheduled tasks' in Help & Support you'll get a lot of reading material.

    Joe
    Joe

  9. #9
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    <P ID="edit" class=small>(Edited by TimOz on 03-Jun-03 14:42. I stuffed up!)</P><span style="background-color: #FFFF00; color: #000000; font-weight: bold">This is mostly untrrue <img src=/S/woops.gif border=0 alt=woops width=58 height=36> </span hi> see <post#=260501>post 260501</post#> and <post#=260582>post 260582</post#> for the real thing.

    The user has to be logged on for their scheduled jobs to run. The "silent fail" is just a non-event because the scheduler for Backup isn't running when the user isn't logged on. It would be nice if windows had a real batch or job environment, so jobs could be run independently of the user. Unfortunately you need a more industrial strength OS to do so.

    There is a way around it, though. First, enable fast user switching (Control Panel | User Accounts | Change the way users log on or off). Then you can log on as Backup, so the job will run, and switch back to your real self to do other work. Your unwanted screen displays won't show until you switch back to Backup. But be aware that files you have in use won't be backed up. It's also probably a good idea to make Backup an administrator so it can backup anyone's files.
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  10. #10
    5 Star Lounger
    Join Date
    Dec 2002
    Location
    Perth, Western Australia, Australia
    Posts
    730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scheduling a .BAT script has me confused (XP Home)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/woops.gif border=0 alt=woops width=58 height=36> Thanks Joe - at least when I stuff up, it's educational! <img src=/S/grin.gif border=0 alt=grin width=15 height=15> This one goes in the "learn something new every day" category. Sorry for the misinformation earlier <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15> I would have replied sooner, but had to read & play first to give myself a chance of getting it at least half right this time.

    Yes, tasks will run, even when you're not logged on. Screen displays won't show (of course) but, as long as user input is not needed, the task will run fine. I'm on home, so no access to policies to change the default settings, but it all seems to work. The "Wake the computer to run this task" option looks handy, but I havent tried it out yet.

    The log is a useful check, but initially looked like it wasn't working because neither entries at start nor end were changing. Then scrolling through it I chanced on the line "[ ***** Most recent entry is above this line ***** ]" (no idea why it updates in the middle of the log?). Normally the start, finish and exit code are logged. If the task starts via a shortcut only the start is logged.

    An administrator can schedule tasks on behalf of any user. A normal user can only schedule their own tasks. Administrators can also use the "at" command to run tasks under the "AT service" account. That too was a new one for me, and good to know about.

    The problem now is I have no idea why Andrew's backup task didn't work? It should have at least shown up in the log.
    <font face="Comic Sans MS" color="blue">TimOz</font>
    <img src=/S/flags/Finland.gif border=0 alt=Finland width=30 height=18> <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •