Task Scheduler does not Run .vbs file

Anonymous
2024-10-22T10:05:10+00:00

Hi - i have scheduled the automated start of a script for SAP (.vbs file) when I run it, it's working fine, but when I schedule a task system does not run the script - just opens the "open with" window and searches for a program to execute.

Microsoft Windows Based Script Host is set as default for vbs files already.

Thanks

*** Moved from Microsoft 365 and Office / Other / For business / Other ***

Windows for business Windows Client for IT Pros User experience Remote desktop services and terminal services

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes
Accepted answer
  1. Anonymous
    2024-10-23T12:35:19+00:00

    Hello,

    Thank you for posting in the Microsoft community forum.

    I understand that you can run this script manually, but it won't work properly under task scheduler.

    It is recommended that you first check the following configuration:

    1. Ensure that the task scheduler is running as a user with sufficient permissions. Try to check the "Run with highest permission" option.
    2. Ensure that the Actions TAB in the task scheduler is configured correctly. The action should be to launch wscript.exe and pass your.vbs file as a parameter. Note If the path contains Spaces, use double quotation marks. For example:

    Program/script: wscript.exe

    Add parameter: "C:\path\with spaces\to\your\script.vbs"

    You can try creating a simple batch file (.bat) to invoke your script and schedule the task scheduler to run this batch file.

    For example, create a '.bat 'file with the following content:

    @echo off
    
    wscript "C:\path\to\your\script.vbs"
    

    I hope this helps.

    Best regards

    Jacen

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful