Windows 7 Task Scheduler - Win 7 64-bit - problem running .bat file "Hello..."

bagel466

New Member
Joined
May 23, 2012
Messages
2
Hi,

I'm having a problem trying to automatically run a basic .bat file in task scheduler in windows 7 64-bit.

I have more complicated .bat files to schedule but I can't get a simple one to run.

This is the .bat file:

@ECHO OFF
ECHO hello there...
PING 1.1.1.1 -n 1 -w 5000 >NUL

It works fine manually - it opens a window and displays the message and then closes after 5 seconds - no problems.

If I schedule it to automatically run in task scheduler nothing happens - no window appears - but it says its running.

I did create a .bat file in the same directory containing:

shutdown /r

This launched fine using task scheduler - the computer restarted - great.

Any ideas how to get a simple .bat file to execute in task scheduler other than restarting the computer?

I'm losing my hair - it shouldn't be this difficult.

Thanks.
 

Last edited by a moderator:
Solution
It sounds like you are facing an issue with running a basic .bat file using Task Scheduler in Windows 7 64-bit. Here are some steps you can try to troubleshoot and resolve the problem:

Steps to Troubleshoot Running a .bat File in Task Scheduler:​

  1. Run Task Scheduler with Highest Privileges:
    • Open Task Scheduler.
    • Right-click on your task and select "Properties."
    • In the "General" tab, check "Run with highest privileges."
    []Set the Start In (Optional):
    • Ensure that in the task properties, the "Start in" field is set to the directory where your .bat file is located. This can help ensure the script runs correctly.
    [
    ]Configure Task Scheduler Actions:
    • Ensure that the...
It sounds like you are facing an issue with running a basic .bat file using Task Scheduler in Windows 7 64-bit. Here are some steps you can try to troubleshoot and resolve the problem:

Steps to Troubleshoot Running a .bat File in Task Scheduler:​

  1. Run Task Scheduler with Highest Privileges:
    • Open Task Scheduler.
    • Right-click on your task and select "Properties."
    • In the "General" tab, check "Run with highest privileges."
    []Set the Start In (Optional):
    • Ensure that in the task properties, the "Start in" field is set to the directory where your .bat file is located. This can help ensure the script runs correctly.
    [
    ]Configure Task Scheduler Actions:
    • Ensure that the action in Task Scheduler is correctly set up to run the .bat file.
    • Action: Start a program
    • Program/script: Path to your .bat file
    • Start in (optional): Path to the directory containing the .bat file
    []Check Security Settings:
    • Make sure your Windows 7 user account has the necessary permissions to run the .bat file.
    • Check if the file is located in a restricted directory.
    [
    ]Check Task Scheduler Log:
    • Check the Task Scheduler log to see if there are any error messages or clues as to why the .bat file is not running as expected.
  2. Add PAUSE Command (Optional):
    • Add a PAUSE command at the end of your .bat file. This can help keep the window open after execution, allowing you to see any error messages. Try these steps and see if they help resolve the issue. If you continue to face problems, you may need to dig deeper into the Task Scheduler logs to identify the specific cause of the failure. Hopefully, this helps you in getting your basic .bat file to execute successfully through Task Scheduler. Let me know if you need further assistance!
 

Solution
Back
Top