![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | scripting schtasks Hi, Need some advice please. My problem in short: How can I script a task to run under user/other credentials without user intervention and without exposing the password through the script? In more detail: I have a logon script that creates a Scheduled Task, once, at a random time. The task itself consists of running a standalone vbs (let's call it MyScript.vbs) file to be executed. MyScript.vbs itself works fine, it compares and copies some files from a network server to the local machine. The task is created without problem, code goes something like this (example is bogus code, but it works, this is not the problem) oWSH.Run "schtasks.exe /create /tn MyTask /sc ONCE /st SomeTime /sd SomeDate /tr x:\path\MyScript.vbs /ru SYSTEM" The problem is that while the task is created fine, and upon further inspection in the Task Scheduler looks fine to me, it does not get executed. It will simply error saying "Could not start". When I create this task using my own credentials, it will run fine. If I create it to run as System, it will fail. So there's the error. I need to somehow pass the users or other credentials to the task to be created, but I would like not to expose the password in the logon script that creates the task. Any suggestions greatly appreciated, tia, arno |
My System Specs![]() |
| | #2 (permalink) |
| | Re: scripting schtasks "Al Dunbar" <alandrub@xxxxxx> wrote in message news:uqXMj56iJHA.4868@xxxxxx Quote: > > "arno" <rnospam_AT_xs4all_DOT_nl> wrote in message > news:iae3p4hlfhg0n7rr07ljm9ogc7rveid3l1@xxxxxx Quote: >..snip Quote: Quote: >> When I create this task using my own credentials, it will run fine. If >> I create it to run as System, it will fail. > This may be because the SYSTEM account lacks access to the network > resources that the script is attempting to access. > Quote: >..snip Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: scripting schtasks Al, Richard, tx for the input arno On Tue, 10 Feb 2009 16:21:47 -0600, "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote: Quote: > >"Al Dunbar" <alandrub@xxxxxx> wrote in message >news:uqXMj56iJHA.4868@xxxxxx Quote: >> >> "arno" <rnospam_AT_xs4all_DOT_nl> wrote in message >> news:iae3p4hlfhg0n7rr07ljm9ogc7rveid3l1@xxxxxx Quote: >>..snip Quote: Quote: >>> When I create this task using my own credentials, it will run fine. If >>> I create it to run as System, it will fail. >> This may be because the SYSTEM account lacks access to the network >> resources that the script is attempting to access. >> >If so, grant permissions to the computer object in Active Directory. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Schtasks.exe error | Vista General | |||
| Cannot create run-once task with schtasks | Vista General | |||
| Change tasks runtime using schtasks | Vista General | |||
| Can't display or change a task with schtasks.exe | Vista account administration | |||
| schtasks Does Not Run It When The Path of the Task Contains a Spac | Vista General | |||