Questions about Windows 2003 schedule task

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • datactrl
    New Member
    • Jul 2008
    • 51

    Questions about Windows 2003 schedule task

    I have a wsh file in with some arguments. It runs fine with a shortcut passed required arguments. When I specified the same command line in schedule task. It seems the wsh cannot read arguments. So I have to use a bath file comes with argument run on the task. Then it works.

    On schedule task:
    Code:
    c:\script\a.wsh a1 a2
    the a.wsh won't see all the arguments

    Bath file a.bat
    Code:
    c:\script\a.wsh a1 a2
    On task:
    Code:
    c:\script\a.bat
    Then it works fine.
  • datactrl
    New Member
    • Jul 2008
    • 51

    #2
    I've got the solution. On schedule task should be like:
    Code:
    wscript c:\script\a.wsf a1 a2
    then a.wsf will see all the argument a1 and a2.

    Comment

    Working...