Hi Guys,
A newbie need some expert help on a script to create scheduled task on
remote computers...

I found one on technet; and edit slightly...

strComputer = InputBox("Machine name","Remote Software Deployment")
Set objService = GetObject("winmgmts:\\" & strComputer)
Set objNewJob = objService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
("Monitor.exe", "********123000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
If Err.Number = 0 Then
Wscript.Echo "New Job ID: " & JobID
Else
Wscript.Echo "An error occurred: " & errJobCreated
End If

Can any one tell me how can I have additonal prompt boxes to allow the
input for:
1. command line
2. the time task scheduled to run

Thanks alot



--
eang18
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

RE: Script to create scheduled task on remote computers by RunningWolf

RunningWolf
Fri Nov 04 23:22:02 CST 2005

I have found it helpful to incorporate the SCHTASKS command-line utility,
when creating tasks on remote servers with vbscript. It is available on XP
and 2003 systems. It can still be used to schedule tasks on 2000 systems.
If you type SCHTASKS /CREATE /? , you will find all the options available.

"eang18" wrote:

>
> Hi Guys,
> A newbie need some expert help on a script to create scheduled task on
> remote computers...
>
> I found one on technet; and edit slightly...
>
> strComputer = InputBox("Machine name","Remote Software Deployment")
> Set objService = GetObject("winmgmts:\\" & strComputer)
> Set objNewJob = objService.Get("Win32_ScheduledJob")
> errJobCreated = objNewJob.Create _
> ("Monitor.exe", "********123000.000000-420", _
> True , 1 OR 4 OR 16, , , JobID)
> If Err.Number = 0 Then
> Wscript.Echo "New Job ID: " & JobID
> Else
> Wscript.Echo "An error occurred: " & errJobCreated
> End If
>
> Can any one tell me how can I have additonal prompt boxes to allow the
> input for:
> 1. command line
> 2. the time task scheduled to run
>
> Thanks alot
>
>
>
> --
> eang18
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------
>
>