Passing multiple arguments in vbscript

68 Views Asked by At

I have to pass multiple arguments in my .vbs script but the problem is the script does not get executed from windows task schedular if I pass multiple arguments separated by white spaces. I am running the script like below,

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

where the syntax is as below,

cscript//nologo Script_path ORACLE_HOME Backup_type Backup_directory retention_day

Thank you for your help in advance!

CKP

1

There are 1 best solutions below

2
Vamp On

Try using brackets for multiple arguments.

  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"

If that does't work, try using a batch script.

@echo off
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"

How to create a batch script on Windows