Hello all,

I'm having a little issue.    I exported my scheduled tasks into a csv file using the 
command:

schtasks /query /fo csv /s dcweb1 /v > test.tasks.csv

When I run the following script:

<?xml version="1.0"?>
<project name="Copy ScheduledTasks" default="display">

        <property name="test.tasks.file" value="test.tasks.csv" />

        <target name="display">
                <foreach item="Line" in="${test.tasks.file}" delim="," 
property="host.name,task.name,next.run.time,status,logon.mode,last.run.time,last.result,creator,schedule,task.to.run,start.in,comment,task.state,task.type,start.time,start.date,end.date,days,months,run.as,delete.task.ifnot.rescheduled,stop.task.if.runsx.hours.and.x.mins,repeat.every,repeat.until.time,repeat.until.duration,repeat.stop.if.still.running,idle.time,power.management">
            
                        <if test="${host.name=='dcweb1'}">
                                <echo 
message="*******************************************************************" />
                                <echo message="task.name                           = 
${task.name}" />
                                <echo message="next.run.time                       = 
${next.run.time}" />
                                <echo message="status                              = 
${status}" />
                                <echo message="logon.mode                          = 
${logon.mode}" />
                                <echo message="last.run.time                       = 
${last.run.time}" />
                                <echo message="last.result                         = 
${last.result}" />
                                <echo message="creator                             = 
${creator}" />
                                <echo message="schedule,task.to.run                = 
${schedule,task.to.run}" />
                                <echo message="start.in                            = 
${start.in}" />
                                <echo message="comment                             = 
${comment}" />
                                <echo message="task.state                          = 
${task.state}" />
                                <echo message="task.type                           = 
${task.type}" />
                                <echo message="start.time                          = 
${start.time}" />
                                <echo message="start.date                          = 
${start.date}" />
                                <echo message="end.date                            = 
${end.date}" />
                                <echo message="days                                = 
${days}" />
                                <echo message="months                              = 
${months}" />
                                <echo message="run.as                              = 
${run.as}" />
                                <echo message="delete.task.ifnot.rescheduled       = 
${delete.task.ifnot.rescheduled}" />
                                <echo message="stop.task.if.runsx.hours.and.x.mins = 
${stop.task.if.runsx.hours.and.x.mins}" />
                                <echo message="repeat.every                        = 
${repeat.every}" />
                                <echo message="repeat.until.time                   = 
${repeat.until.time}" />
                                <echo message="repeat.until.duration               = 
${repeat.until.duration}" />
                                <echo message="repeat.stop.if.still.running        = 
${repeat.stop.if.still.running}" />
                                <echo message="idle.time                           = 
${idle.time}" />
                                <echo message="power.management                    = 
${power.management}" />
                                <echo 
message="*******************************************************************" />
                        </if>
                </foreach>
        </target>
</project>

I will get the following error:

Too many items on line:
NAnt.Core.BuildException: C:\Documents and Settings\fvittoria\copytasks.build(7,
4):
Too many items on line
   at NAnt.Core.Tasks.LoopTask.DoWork(String[] propVals) in d:\Source\nant-20041
021T194026Z\src\NAnt.Core\Tasks\LoopTask.cs:line 418
   at NAnt.Core.Tasks.LoopTask.DoWorkOnFileLines(String filename) in d:\Source\n
ant-20041021T194026Z\src\NAnt.Core\Tasks\LoopTask.cs:line 450
   at NAnt.Core.Tasks.LoopTask.ExecuteTask() in d:\Source\nant-20041021T194026Z\
src\NAnt.Core\Tasks\LoopTask.cs:line 364
   at NAnt.Core.Task.Execute() in d:\Source\nant-20041021T194026Z\src\NAnt.Core\
Task.cs:line 177
   at NAnt.Core.Target.Execute() in d:\Source\nant-20041021T194026Z\src\NAnt.Cor
e\Target.cs:line 249
   at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) in
 d:\Source\nant-20041021T194026Z\src\NAnt.Core\Project.cs:line 876
   at NAnt.Core.Project.Execute() in d:\Source\nant-20041021T194026Z\src\NAnt.Co
re\Project.cs:line 833
   at NAnt.Core.Project.Run() in d:\Source\nant-20041021T194026Z\src\NAnt.Core\P
roject.cs:line 902

Is this correct?   

My goal is to copy scheduled tasks from one machine to another.   What I was thinking 
of doing is creating a CSV file from the "source" machine and then using NAnt to 
"import" that list on the "target" machine.    Is there an easier way?   

Thanks,
Felice


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to