Run .VBS scrpt from windows task sceduler

CKP 1 Reputation point
2023-01-06T03:37:17.017+00:00

HI There,
I have .vbs script and need to run from windows task scheduler to backup database.
I have created the .bat file as,
cscript//nologo D:\test\test_backup.vbs PRD D:\Oracle hot D:\Oracle\DB_Backup\test 1
This script has to pass multiple parameters like database name, binary home, backup location....
This script is not executing from task scheduler but it runs successfully if I execute the same batch script from command prompt manually. Any help please?
Thanks
CKP

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,441 questions
{count} votes

3 answers

Sort by: Most helpful
  1. CKP 1 Reputation point
    2023-01-06T06:19:12.697+00:00

    Hi @Takahito Iwasa
    No this is Windows 10 & 2019 server Scheduler. Accidently it got tagged to Azure Scheduler. Sorry.
    Thanks

    0 comments No comments

  2. Olaf Helper 45,626 Reputation points
    2023-01-06T07:59:37.83+00:00

    but it runs successfully if I execute the same batch script from command prompt manually

    Then I guess it's a permission issue. By default jobs runs under the scheduler service account, but you change this in the job settings to your credentials, as you have the permissions to run the script/it's content.

    0 comments No comments

  3. CKP 1 Reputation point
    2023-01-06T12:15:32.477+00:00

    @Olaf Helper
    Thank you for the response but if I click on run in the job like a simple command in script as below without passing many parameters as below. I have to click on run as it is also not running automatically but after clicking run it gives me the output,
    cscript //nologo D:\test\test.vbs >D:\test\test.log
    But in my actual script it has to pass four parameters as below and this is not running,
    cscript//nologo D:\test\CPWinOraBackup0.100.vbs test_db D:\Oracle\WINDOWSX64_193000_db_home rman_hot D:\Oracle\DB_Backup\test_db 1> D:\test\test.log
    Thank you for your help in advance!
    CKP

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.