Task Scheduler ignores command-line parameter 
Author Message
 Task Scheduler ignores command-line parameter

When I try to execute a VBS script from W2K Task Scheduler with a
numeric command-line parameter, the script starts up but
WScript.Arguments.length=0. If the script is started up via a shortcut
or from the command line with a numeric parameter, the
WScript.Arguments object is populated.

How can I pass command-line parameters to my VBS script from Task
Scheduler? Why isn't it working in the first place?

regards, Andy

                                   **********

           The X's have been added to my email address to thwart spam.
                            Take them out to reply.

                                   **********



Tue, 27 Apr 2004 19:30:37 GMT  
 Task Scheduler ignores command-line parameter
Instead of

Run: "c:\my script path\myscript.vbs" 666

use

Run: wscript.exe "c:\my script path\myscript.vbs" 666

or cscript.exe if you need console mode...

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> When I try to execute a VBS script from W2K Task Scheduler with a
> numeric command-line parameter, the script starts up but
> WScript.Arguments.length=0. If the script is started up via a shortcut
> or from the command line with a numeric parameter, the
> WScript.Arguments object is populated.

> How can I pass command-line parameters to my VBS script from Task
> Scheduler? Why isn't it working in the first place?

> regards, Andy

>                                    **********

>            The X's have been added to my email address to thwart spam.
>                             Take them out to reply.

>                                    **********



Wed, 28 Apr 2004 05:02:04 GMT  
 Task Scheduler ignores command-line parameter
Thanks, works great!

regards, Andy


Quote:
>Instead of

>Run: "c:\my script path\myscript.vbs" 666

>use

>Run: wscript.exe "c:\my script path\myscript.vbs" 666

>or cscript.exe if you need console mode...

>--
>Michael Harris
>Microsoft.MVP.Scripting

                                   **********

           The X's have been added to my email address to thwart spam.
                            Take them out to reply.

                                   **********



Wed, 28 Apr 2004 06:56:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. W2k Task-Scheduler -> find hanging tasks

2. Setting Username and Passwords for a scheduled task in MS Task Scheduler

3. Setting Username and Passwords for a scheduled task in MS Task Scheduler

4. Submit a task to the Task Scheduler

5. end task Outlook.exe from command line?

6. Parameters in command line location calls

7. reading a parameter from the command line?

8. Command Line Parameters for wsh?

9. Executing vbscript with command line parameters

10. Command Line Parameters

11. Accessing Command-Line parameters from a program.vbs

12. Taking a parameter from the command line

 

 
Powered by phpBB® Forum Software