Re: schtask to run task now or in 2 minutes

From: Greg (Greg_at_discussions.microsoft.com)
Date: 12/22/04


Date: Wed, 22 Dec 2004 07:13:02 -0800

Any one have any thoughts/suggestions regarding the below question?

"Dave Patrick" wrote:

> You might want to ask this one in server.scripting
>
> forwarding to microsoft.public.windows.server.scripting
>
> --
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Greg" wrote:
> | Ok I got my task to schedule and to run using the following format...
> |
> | schtasks /create /tn prog-install /s %1 /u username /p password /tr
> | "\\%1\C$\Temp\progin.BAT" /sc once /st 23:00:00
> | schtasks /run /tn prog-install /s %1 /u username /p password
> |
> | As you can see above I had to imbed my username and password into each
> line.
> | Below I tried to use a set veriable for my password but this did not work
> | even though I did set the veriables at the begining of the script. I have
> | multiple sections of the batch file and don't want to have to put my
> username
> | and password all over the place. I'd like to just set two vaialbles in
> the
> | begining and "read" them when needed. Any ideas here?
> |
> | schtasks /create /tn prog-install /s %1 /u %UNAME /p %UNPW /tr
> | "\\%1\C$\Temp\progin.BAT" /sc once /st 23:00:00
> | schtasks /run /tn prog-install /s %1 /u %UNAME /p %UNPW
> | ===========================================
> | "Dave Patrick" wrote:
> |
> | > Try this one. It works for me.
> | >
> | > schtasks /create /tn NewTask /tr C:\WINDOWS\system32\calc.exe /sc once
> /st
> | > 18:00:00
> | >
> | > --
> | > Regards,
> | >
> | > Dave Patrick ....Please no email replies - reply in newsgroup.
> | > Microsoft Certified Professional
> | > Microsoft MVP [Windows]
> | > http://www.microsoft.com/protect
> | >
> | > "Greg" wrote:
> | > | Dave: Thanks for the info. I found that link but it does not help.
> I
> | > have
> | > | even tried the following in my batch file to get the thing to run but
> that
> | > | has not worked either...
> | > |
> | > | schtasks /create /tn prog-install /s %1 /tr "\\%1\C$\Temp\PROGIN.BAT"
> /sc
> | > | once /st 23:00:00
> | > | ping 1.1.1.1 -n 1 -w 10000 >NUL
> | > | schtasks /run /tn prog-install /s %1
> | > |
> | > | I thought if I scheduled the task and waited 10 seconds then told it
> to
> | > run
> | > | that would do it. The task got created but never ran.
> | >
> | >
> | >
>
>
>



Relevant Pages

  • Re: schtask to run task now or in 2 minutes
    ... "Dave Patrick" wrote: ... > forwarding to microsoft.public.windows.server.scripting ... > | As you can see above I had to imbed my username and password into each ...
    (microsoft.public.windows.server.scripting)
  • Re: IIS authentication Problems
    ... I have changed this option to "Automatic Logon with current username and ... Best Regards, ... > Authentication you will see checked "Automatic logon only in Intranet ... >> on the same subnet with Domain and Web Server, and If I go the this Web ...
    (microsoft.public.inetserver.iis.security)
  • Re: Domain name before username
    ... Best Regards ... I have moved my exchange server from a DC to a member server. ... How can I get rid of that so that the user just enter there username ...
    (microsoft.public.exchange.setup)
  • RE: Retrieving User credentials and Domain name through WMI in ASP.NE
    ... Regards ... "viju82" wrote: ... > 'RemoteEnabled' then it started showing me the username. ... > deploying it on testing machine it is not showing me anything. ...
    (microsoft.public.cert.exam.mcsd)
  • Re: User Cant Login
    ... Seems one or the other must be incorrect. ... I would avoid using spaces in the ... username. ... Dave Patrick ....Please no email replies - reply in newsgroup. ...
    (microsoft.public.win2000.general)