Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 37
  1. #16
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    Try commenting out your "Echo" statements. Task Scheduler tasks run blind, and any request for user input or display output will cause the task to hang.

    Also, post your Task Scheduler Action tab command line as entered in the Program/script textbox.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  2. #17
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by bbearren View Post
    Try commenting out your "Echo" statements. Task Scheduler tasks run blind, and any request for user input or display output will cause the task to hang.
    OK I commented out all the Echo's and that didn't change anything. Since I am piping the echos into a log file I didn't think they would hurt anything! Also, a very similar routine was initiated by the scheduler on my wife's WinXP machine without any problem.

    Quote Originally Posted by bbearren View Post
    Also, post your Task Scheduler Action tab command line as entered in the Program/script textbox.
    I also tried changing the command line to a Call statement to see if that would make any difference and it did not. A picture of the commandline is attached.

    Thanks for sticking with me on this! I don't know if there is anything else I could try, but I'll be glad to try if you have any more ideas.

    Bill
    Attached Images Attached Images

  3. #18
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    I should have mentioned this in my earlier message: When I started to initiate my task in the scheduler the scheduler indicated that the task was still running, from yesterday's initiation! I stopped it and got confirmation for that before I tried the tests I ran today. So, it is obviously being blocked from actually doing anything by something. One other thing: The .bat files are located at C:\Data\BatFiles and the files are being created at C:\Backups. Neither of these locations is in the section of folders that are listed under the Admin account or the User account. I don't know if that matters or not.

    Bill

  4. #19
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    NEW SITUATION! I have been editing the batch files and running the tests mostly in the Admin account where the failures have been happening. I decided tonight that I should try running a test from the User account where I expect it to be used. It actually ran! At least it ran part way. I have finally captured a screen shot of the CMD window after the run aborted and I have a crazy situation.

    The batch files are all in C:\Data\BatFiles. At first I had the log file being created in C:\Backups but i decided yesterday or the day before to move it to C:\Data. So, I've edited all the files that contain an Echo command to show the new location. However, in the screen shot that I just captured the path to the log file is C:\Backups!!! It also aborted when it encountered an End command which I had used incorrectly when I intended to use Exit. I corrected that mistake several days ago! It acts like the old versions of the files have been saved somewhere and are being used! Is that possible? Any idea why this is happening?

    Thanks,
    Bill

  5. #20
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    Could you have created the task more than once, or in both accounts?

    In light of that situation, it would seem advisable to delete the task(s), do a cold reboot (shut down completely, wait 30 seconds, then restart) and create the task from scratch.
    Last edited by bbearren; 2014-04-25 at 05:05.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  6. #21
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by bbearren View Post
    Could you have created the task more than once, or in both accounts?
    The system will not let me make any changes in the Task Scheduler while I'm logged in in the User account. I have done some editing of the batch files while logged in to the User account. Also, as I said before, the actual file location is not in the group of folders that seem to be assigned to one account or the other, They are located at C:\Data\BatFiles; two folders that I created myself.


    Quote Originally Posted by bbearren View Post
    In light of that situation, it would seem advisable to delete the task(s), do a cold reboot (shut down completely, wait 30 seconds, then restart) and create the task from scratch.
    I just deleted the scheduled task while in the Admin account and then switched to the user account and opened the task scheduler to make sure it was actually gone there too. The task was actually triggered and it ran while I was doing that! But the task is no longer listed in the scheduler. So, then I shutdown completely and then booted up again and logged into the Admin account and created the task completely from scratch and set it to trigger in a couple of minutes. Then I switched to the User account and watched the screen. The Cmd window opened up and the task ran again and used the old files with the old locations that I changed several days ago and aborted when it encountered the 'end' statement that was in that old version of the file by mistake!!

    Bill

  7. #22
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    Yes, the old files could definitely be gumming up the works, but also, you shouldn't be seeing the Cmd window. Scheduled tasks are supposed to run blind, in the background.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  8. #23
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    While I do use Task Scheduler to do most of my system maintenance, I don't use batch files. Using Task Scheduler is much like using a batch file. I've just setup something similar to a batch file to run in Task Scheduler in a couple of minutes. I'll see how it works...
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  9. #24
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    A couple of things: open MMC (Microsoft Management Console) and get into Task Scheduler from there. See if your old batch files are still referenced from there, and delete them if they are.

    I was able to get Task Scheduler to run a complex command line, and also turn that command line into a script and get Task Scheduler to run that, as well. Here is the command line:

    C:\Windows\System32\cmd.exe /c G:\PsTools\Psexec -i -s Cmd.exe /c C:\Windows\System32\Cleanmgr.exe /sagerun:01

    What it amounts to is a system level Disk Cleanup (the /c switches tell the command windows to close upon completion). When I entered this command line directly into the Action tab, Task Scheduler offered to split it into "Program/script:" and "Add arguments (optional):" and I allowed it to do that. However, trying to run it as SYSTEM resulted in "running" without completion.

    I turned it into a script by pasting it into notepad and saving it with .cmd on my desktop (regular user). Again, trying to run as SYSTEM resulted in "running" without completion.

    When I changed the General tab to run as Admin (an account of mine in the Administrators group) whether the user is logged on or not, with highest privileges, when I finished creating the task, it asked for Admin's password. I complied, and finished the task.

    When run as Admin, the command line completed successfully, and the cmd script (T:\Users\bbearren\Desktop\SysLevCln.cmd) completed successfully.

    Finally, I saved it as a batch file, scheduled it as a task (T:\Users\bbearren\Desktop\SysLevCln.bat) and let that run. That also completed successfully.

    Either the lingering 'old' batch file is causing problems, or there might be something in your syntax that is causing the hang in Task Scheduler. Also, every folder/file in the sequence must have Security Properties with full control for your Administrators account to avoid permisssions hangs.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  10. #25
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    I'm back home now, after a busy weekend elsewhere. Boy, you have been busy working on this! I really appreciate that. I'll work on this and get back to you when I have something to report.

    Bill

  11. #26
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    Quote Originally Posted by bbearren View Post
    A couple of things: open MMC (Microsoft Management Console) and get into Task Scheduler from there. See if your old batch files are still referenced from there, and delete them if they are. . .
    Well, now that I'm back on this task again, I don't know what Microsoft Management Console is and I can't find it! I've searched for that name and looked all through the Control Panel without success. Please tell me where to look or how to get into it.

    Thanks,
    Bill

  12. #27
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    Mystery Solved! I got smart and googled Microsoft Management Console and learned how to get to it and opened the scheduler there and finally found my mistake. I was running the wrong file!

    I found I have two initiating .bat files that have very similar names and I've been adjusting one to get things the way I want them and I was running the other one that still had a lot of problems in it. All versions of that file have been deleted now. The correct one should be running now but since a scheduled task runs blind I can't tell if it is or not. I'll look for the results in a little bit. That raises a question: can you see a running batch process in the Task Manager somewhere?

    Sorry about the dumb mistake. Thanks for all your help.
    Bill

  13. #28
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    It is possible to see the process(s) that the batch file calls while it is running using Task Manager.
    Last edited by bbearren; 2014-05-01 at 12:31.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  14. #29
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    652
    Thanks
    0
    Thanked 2 Times in 1 Post
    I'm back! I have been busy on other things but I just learned from my wife that the old bat files job still runs and aborts everytime she logs into the laptop! It aborts because it is still using those old files that had the wrong folder names and the invalid 'end' statement! The problem is, those files no longer exist; I deleted them all! In the User account, the scheduler does not show anything except 3 tasks that were put there by some other software. In the Admin account right now there is one scheduled batch job that I created but it is a Run Once job that has already run and completed. There has also been a period of several days, a week or so ago, when there was no scheduled batch job in either account so I don't think the new scheduled batch job in the Admin account is related to the problem. Do you have any idea how to get rid of this invisible scheduled task?

    Thanks,
    Bill

  15. #30
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    If you're not spooked by looking in the registry, you can open the registry and do a "Find" for the name of your batch file. That might provide a clue.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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