More likely, he simply assumed that the profile folder name would be the
same as the username in question. Another trick to making scripts robust is
to avoid assumptions that are not universally correct, and get the
information required from the operating system. There are a couple of ways
of determining the fully qualified path to certain "special folders" in
vbscript - the equivalent in batch mode would be something like:
"Pegasus [MVP]" <news@xxxxxx> wrote in message
> This probably means that you did not fully qualify your file names. Again,
> if you want your scripts to be robust then you *must* fully qualify all
> file names.
> "Rich" <richjone@xxxxxx> wrote in message
>>I think I figured it out. I looked in Documents and Settings, and the
>> name for the administrator was "administrator.000" instead of just
>> administrator. after cleaning that up, I logged back in with my domain
>> account, then can run the task.
>> "Pegasus [MVP]" wrote:
>>> "Rich" <richjone@xxxxxx> wrote in message
>>> >I have a vbscript that when I launch it manually it runs and closes in
>>> > 5 minutes. I created a new Scheduled Task on my server, having it
>>> > just
>>> > run
>>> > the .vbs file (the vbs path\filename is the only thing in the Run
>>> > box),
>>> > but
>>> > it it still running after 10 minutes and I can't tell why so I
>>> > cancelled
>>> > it.
>>> > Is there a better way to setup the scheduled task so it will stop
>>> > "running"
>>> > (whether it finished and didn't close or whether it was still running
>>> > after
>>> > 10 minutes which it shouldn't have been).
>>> If you want your scripts to be robust then you must invoke them
>>> instead of relying on some associations that may or may not work.
>>> Instead of
>>> you should run
>>> cscript.exe //nologo c:\Scripts\MyScript.vbs
>>> This will probably solve your problem. If it doesn't, log on under the
>>> account as the one used for the scheduled task, then launch that task in
>>> Task Scheduler and watch what happens.