Hi All,

I have a vbscript that has 2 command line parameters
It runs fine from the shortcut or "Run" with the command
line
myscript.vbs para1 para2

However, when I put it in the Scheduled Tasks, it does not
work.
To make it work I have to put "...\wscript.exe
..\myscript.vbs para1 para2

Is there any way to avoid having to use "wscript" ?

Thanks
al

Re: scheduled tasks by Pegasus

Pegasus
Thu Oct 18 13:57:55 PDT 2007


"Al Marino" <almarino_AT_intelliform.net> wrote in message
news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
> Hi All,
>
> I have a vbscript that has 2 command line parameters
> It runs fine from the shortcut or "Run" with the command line
> myscript.vbs para1 para2
>
> However, when I put it in the Scheduled Tasks, it does not work.
> To make it work I have to put "...\wscript.exe ..\myscript.vbs para1 para2
>
> Is there any way to avoid having to use "wscript" ?
>
> Thanks
> al
>
>

There probably is by setting an appropriate association
for .vbs files but I wonder what the problem is. Writing
your post will have already consumed far more time than
it takes to prefix the command with "wscript.exe".



Re: scheduled tasks by Al

Al
Fri Oct 19 09:04:39 PDT 2007

Hi Pegasus,

The reason I wanted to avoid wscript is that this script
will be used by clueless users and the less confusing, the
better.

al

ps. File association does not work


"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>
> "Al Marino" <almarino_AT_intelliform.net> wrote in message
> news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>> Hi All,
>>
>> I have a vbscript that has 2 command line parameters
>> It runs fine from the shortcut or "Run" with the command
>> line
>> myscript.vbs para1 para2
>>
>> However, when I put it in the Scheduled Tasks, it does
>> not work.
>> To make it work I have to put "...\wscript.exe
>> ..\myscript.vbs para1 para2
>>
>> Is there any way to avoid having to use "wscript" ?
>>
>> Thanks
>> al
>>
>>
>
> There probably is by setting an appropriate association
> for .vbs files but I wonder what the problem is. Writing
> your post will have already consumed far more time than
> it takes to prefix the command with "wscript.exe".
>
>



Re: scheduled tasks by Pegasus

Pegasus
Fri Oct 19 09:36:57 PDT 2007

I detect a slight contradiction here. If your users are
clueless then they should not schedule tasks. If they
can schedule tasks then they are not clueless.

My own file association for VBS files looks like this:

C:\>associate .vbs
Association for ".vbs" is C:\WINDOWS\System32\CScript.exe "%1" %*

What's yours?


"Al Marino" <almarino_AT_intelliform.net> wrote in message
news:eLUjEnmEIHA.5604@TK2MSFTNGP04.phx.gbl...
> Hi Pegasus,
>
> The reason I wanted to avoid wscript is that this script will be used by
> clueless users and the less confusing, the better.
>
> al
>
> ps. File association does not work
>
>
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>>
>> "Al Marino" <almarino_AT_intelliform.net> wrote in message
>> news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>>> Hi All,
>>>
>>> I have a vbscript that has 2 command line parameters
>>> It runs fine from the shortcut or "Run" with the command line
>>> myscript.vbs para1 para2
>>>
>>> However, when I put it in the Scheduled Tasks, it does not work.
>>> To make it work I have to put "...\wscript.exe ..\myscript.vbs para1
>>> para2
>>>
>>> Is there any way to avoid having to use "wscript" ?
>>>
>>> Thanks
>>> al
>>>
>>>
>>
>> There probably is by setting an appropriate association
>> for .vbs files but I wonder what the problem is. Writing
>> your post will have already consumed far more time than
>> it takes to prefix the command with "wscript.exe".
>>
>>
>
>



Re: scheduled tasks by Al

Al
Fri Oct 19 12:18:53 PDT 2007

I get:

assoc .vbs
.vbs=vbsfile
ftype vbsfile
vbsfile=....WScript.exe "%1" %*

if this wasn't so, it would not work in a shortcut
there appears to be a problem with the Task Scheduler, it
does not pass any parameters
do you know why or a fix ?

our users may be clueless, but they follow directions fairly
well
our experience is that mistakes go up exponentially with
complexity, hence my question

al



"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:%23290E5mEIHA.4748@TK2MSFTNGP06.phx.gbl...
>I detect a slight contradiction here. If your users are
> clueless then they should not schedule tasks. If they
> can schedule tasks then they are not clueless.
>
> My own file association for VBS files looks like this:
>
> C:\>associate .vbs
> Association for ".vbs" is C:\WINDOWS\System32\CScript.exe
> "%1" %*
>
> What's yours?
>
>
> "Al Marino" <almarino_AT_intelliform.net> wrote in message
> news:eLUjEnmEIHA.5604@TK2MSFTNGP04.phx.gbl...
>> Hi Pegasus,
>>
>> The reason I wanted to avoid wscript is that this script
>> will be used by clueless users and the less confusing,
>> the better.
>>
>> al
>>
>> ps. File association does not work
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>> news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>
>>> "Al Marino" <almarino_AT_intelliform.net> wrote in
>>> message news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>> Hi All,
>>>>
>>>> I have a vbscript that has 2 command line parameters
>>>> It runs fine from the shortcut or "Run" with the
>>>> command line
>>>> myscript.vbs para1 para2
>>>>
>>>> However, when I put it in the Scheduled Tasks, it does
>>>> not work.
>>>> To make it work I have to put "...\wscript.exe
>>>> ..\myscript.vbs para1 para2
>>>>
>>>> Is there any way to avoid having to use "wscript" ?
>>>>
>>>> Thanks
>>>> al
>>>>
>>>>
>>>
>>> There probably is by setting an appropriate association
>>> for .vbs files but I wonder what the problem is. Writing
>>> your post will have already consumed far more time than
>>> it takes to prefix the command with "wscript.exe".
>>>
>>>
>>
>>
>
>



Re: scheduled tasks by Pegasus

Pegasus
Fri Oct 19 14:29:59 PDT 2007

I have no problem scheduling a .vbs script with your particular
association. I suspect the script fails in the scheduled task
because the .vbs file resides in a folder that is included in the
path when you run it under your own logon session but not when you run it as
a
scheduled task. Have a closer look at the Task Scheduler log
file, then run your next test with a fully qualified command like so:

c:\Tools\myscript.vbs para1 para2


"Al Marino" <almarino_AT_intelliform.net> wrote in message
news:%23CkBkToEIHA.4400@TK2MSFTNGP05.phx.gbl...
>I get:
>
> assoc .vbs
> .vbs=vbsfile
> ftype vbsfile
> vbsfile=....WScript.exe "%1" %*
>
> if this wasn't so, it would not work in a shortcut
> there appears to be a problem with the Task Scheduler, it does not pass
> any parameters
> do you know why or a fix ?
>
> our users may be clueless, but they follow directions fairly well
> our experience is that mistakes go up exponentially with complexity, hence
> my question
>
> al
>
>
>
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:%23290E5mEIHA.4748@TK2MSFTNGP06.phx.gbl...
>>I detect a slight contradiction here. If your users are
>> clueless then they should not schedule tasks. If they
>> can schedule tasks then they are not clueless.
>>
>> My own file association for VBS files looks like this:
>>
>> C:\>associate .vbs
>> Association for ".vbs" is C:\WINDOWS\System32\CScript.exe "%1" %*
>>
>> What's yours?
>>
>>
>> "Al Marino" <almarino_AT_intelliform.net> wrote in message
>> news:eLUjEnmEIHA.5604@TK2MSFTNGP04.phx.gbl...
>>> Hi Pegasus,
>>>
>>> The reason I wanted to avoid wscript is that this script will be used by
>>> clueless users and the less confusing, the better.
>>>
>>> al
>>>
>>> ps. File association does not work
>>>
>>>
>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>>> news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>>
>>>> "Al Marino" <almarino_AT_intelliform.net> wrote in message
>>>> news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>>> Hi All,
>>>>>
>>>>> I have a vbscript that has 2 command line parameters
>>>>> It runs fine from the shortcut or "Run" with the command line
>>>>> myscript.vbs para1 para2
>>>>>
>>>>> However, when I put it in the Scheduled Tasks, it does not work.
>>>>> To make it work I have to put "...\wscript.exe ..\myscript.vbs para1
>>>>> para2
>>>>>
>>>>> Is there any way to avoid having to use "wscript" ?
>>>>>
>>>>> Thanks
>>>>> al
>>>>>
>>>>>
>>>>
>>>> There probably is by setting an appropriate association
>>>> for .vbs files but I wonder what the problem is. Writing
>>>> your post will have already consumed far more time than
>>>> it takes to prefix the command with "wscript.exe".
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: scheduled tasks by Al

Al
Sat Oct 20 06:09:14 PDT 2007

I apologize for not being clear

the Run line in the scheduled task is:
c:\test\myscript.vbs c:\test c:\temp
the startin is
c:\test

the script first checks for 2 parameters, displays a msbox
and quits if not present
the script runs but the parameters are not passed to it
the msgbox shows 0 para passed
the log shows complete with exit code 0 since I just quit if
para are not present

this is the same line as in a shortcut that runs fine
if "wscript" is used in front of the scheduled task run
line, it runs fine

now I am just interested in what is going on

al


"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:%23BzP0cpEIHA.4956@TK2MSFTNGP06.phx.gbl...
>I have no problem scheduling a .vbs script with your
>particular
> association. I suspect the script fails in the scheduled
> task
> because the .vbs file resides in a folder that is included
> in the
> path when you run it under your own logon session but not
> when you run it as a
> scheduled task. Have a closer look at the Task Scheduler
> log
> file, then run your next test with a fully qualified
> command like so:
>
> c:\Tools\myscript.vbs para1 para2
>
>
> "Al Marino" <almarino_AT_intelliform.net> wrote in message
> news:%23CkBkToEIHA.4400@TK2MSFTNGP05.phx.gbl...
>>I get:
>>
>> assoc .vbs
>> .vbs=vbsfile
>> ftype vbsfile
>> vbsfile=....WScript.exe "%1" %*
>>
>> if this wasn't so, it would not work in a shortcut
>> there appears to be a problem with the Task Scheduler, it
>> does not pass any parameters
>> do you know why or a fix ?
>>
>> our users may be clueless, but they follow directions
>> fairly well
>> our experience is that mistakes go up exponentially with
>> complexity, hence my question
>>
>> al
>>
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>> news:%23290E5mEIHA.4748@TK2MSFTNGP06.phx.gbl...
>>>I detect a slight contradiction here. If your users are
>>> clueless then they should not schedule tasks. If they
>>> can schedule tasks then they are not clueless.
>>>
>>> My own file association for VBS files looks like this:
>>>
>>> C:\>associate .vbs
>>> Association for ".vbs" is
>>> C:\WINDOWS\System32\CScript.exe "%1" %*
>>>
>>> What's yours?
>>>
>>>
>>> "Al Marino" <almarino_AT_intelliform.net> wrote in
>>> message news:eLUjEnmEIHA.5604@TK2MSFTNGP04.phx.gbl...
>>>> Hi Pegasus,
>>>>
>>>> The reason I wanted to avoid wscript is that this
>>>> script will be used by clueless users and the less
>>>> confusing, the better.
>>>>
>>>> al
>>>>
>>>> ps. File association does not work
>>>>
>>>>
>>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>>>> news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>>>
>>>>> "Al Marino" <almarino_AT_intelliform.net> wrote in
>>>>> message
>>>>> news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>>>> Hi All,
>>>>>>
>>>>>> I have a vbscript that has 2 command line parameters
>>>>>> It runs fine from the shortcut or "Run" with the
>>>>>> command line
>>>>>> myscript.vbs para1 para2
>>>>>>
>>>>>> However, when I put it in the Scheduled Tasks, it
>>>>>> does not work.
>>>>>> To make it work I have to put "...\wscript.exe
>>>>>> ..\myscript.vbs para1 para2
>>>>>>
>>>>>> Is there any way to avoid having to use "wscript" ?
>>>>>>
>>>>>> Thanks
>>>>>> al
>>>>>>
>>>>>>
>>>>>
>>>>> There probably is by setting an appropriate
>>>>> association
>>>>> for .vbs files but I wonder what the problem is.
>>>>> Writing
>>>>> your post will have already consumed far more time
>>>>> than
>>>>> it takes to prefix the command with "wscript.exe".
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Re: scheduled tasks by Pegasus

Pegasus
Sat Oct 20 08:24:27 PDT 2007

I was able to duplicate your observation. It seems that the
mechanism that processes the .vbs extension under the
Task Scheduler will ignore the parameters. You have
already found a way around this problem. Another way
goes like so:

cmd /c c:\test\myscript.vbs c:\test c:\temp

"Al Marino" <almarino_AT_intelliform.net> wrote in message
news:udKUqpxEIHA.1316@TK2MSFTNGP02.phx.gbl...
>I apologize for not being clear
>
> the Run line in the scheduled task is:
> c:\test\myscript.vbs c:\test c:\temp
> the startin is
> c:\test
>
> the script first checks for 2 parameters, displays a msbox and quits if
> not present
> the script runs but the parameters are not passed to it
> the msgbox shows 0 para passed
> the log shows complete with exit code 0 since I just quit if para are not
> present
>
> this is the same line as in a shortcut that runs fine
> if "wscript" is used in front of the scheduled task run line, it runs fine
>
> now I am just interested in what is going on
>
> al
>
>
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:%23BzP0cpEIHA.4956@TK2MSFTNGP06.phx.gbl...
>>I have no problem scheduling a .vbs script with your
>>particular
>> association. I suspect the script fails in the scheduled
>> task
>> because the .vbs file resides in a folder that is included
>> in the
>> path when you run it under your own logon session but not
>> when you run it as a
>> scheduled task. Have a closer look at the Task Scheduler
>> log
>> file, then run your next test with a fully qualified
>> command like so:
>>
>> c:\Tools\myscript.vbs para1 para2
>>
>>
>> "Al Marino" <almarino_AT_intelliform.net> wrote in message
>> news:%23CkBkToEIHA.4400@TK2MSFTNGP05.phx.gbl...
>>>I get:
>>>
>>> assoc .vbs
>>> .vbs=vbsfile
>>> ftype vbsfile
>>> vbsfile=....WScript.exe "%1" %*
>>>
>>> if this wasn't so, it would not work in a shortcut
>>> there appears to be a problem with the Task Scheduler, it
>>> does not pass any parameters
>>> do you know why or a fix ?
>>>
>>> our users may be clueless, but they follow directions
>>> fairly well
>>> our experience is that mistakes go up exponentially with
>>> complexity, hence my question
>>>
>>> al
>>>
>>>
>>>
>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>>> news:%23290E5mEIHA.4748@TK2MSFTNGP06.phx.gbl...
>>>>I detect a slight contradiction here. If your users are
>>>> clueless then they should not schedule tasks. If they
>>>> can schedule tasks then they are not clueless.
>>>>
>>>> My own file association for VBS files looks like this:
>>>>
>>>> C:\>associate .vbs
>>>> Association for ".vbs" is
>>>> C:\WINDOWS\System32\CScript.exe "%1" %*
>>>>
>>>> What's yours?
>>>>
>>>>
>>>> "Al Marino" <almarino_AT_intelliform.net> wrote in
>>>> message news:eLUjEnmEIHA.5604@TK2MSFTNGP04.phx.gbl...
>>>>> Hi Pegasus,
>>>>>
>>>>> The reason I wanted to avoid wscript is that this
>>>>> script will be used by clueless users and the less
>>>>> confusing, the better.
>>>>>
>>>>> al
>>>>>
>>>>> ps. File association does not work
>>>>>
>>>>>
>>>>> "Pegasus (MVP)" <I.can@fly.com> wrote in message
>>>>> news:uUySOmcEIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>>>>
>>>>>> "Al Marino" <almarino_AT_intelliform.net> wrote in
>>>>>> message
>>>>>> news:%23ZcJrFcEIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I have a vbscript that has 2 command line parameters
>>>>>>> It runs fine from the shortcut or "Run" with the
>>>>>>> command line
>>>>>>> myscript.vbs para1 para2
>>>>>>>
>>>>>>> However, when I put it in the Scheduled Tasks, it
>>>>>>> does not work.
>>>>>>> To make it work I have to put "...\wscript.exe
>>>>>>> ..\myscript.vbs para1 para2
>>>>>>>
>>>>>>> Is there any way to avoid having to use "wscript" ?
>>>>>>>
>>>>>>> Thanks
>>>>>>> al
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> There probably is by setting an appropriate
>>>>>> association
>>>>>> for .vbs files but I wonder what the problem is.
>>>>>> Writing
>>>>>> your post will have already consumed far more time
>>>>>> than
>>>>>> it takes to prefix the command with "wscript.exe".
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>