As you note, the trick of using the extra quotes in the /TR parameter only allows you to use the same directory as where the executable resides. If you want to specify a different working directory, you should use the /XML option and specify an XML file that lists the working directory. The command would be something like this:
SchTasks /Create /TN "Foo" /XML task.xml
The XML file would look something like this:
<?xml version="1.0" ?>
<Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2006-05-02T13:21:17</Date>
<Author>AuthorName</Author>
<Version>1.0.0</Version>
<Description>Call MoveFile</Description>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2011-11-02T00:00:00</StartBoundary>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal>
<UserId>Administrator</UserId>
<LogonType>InteractiveToken</LogonType>
</Principal>
</Principals>
<Settings>
<Enabled>true</Enabled>
<AllowStartOnDemand>true</AllowStartOnDemand>
<AllowHardTerminate>true</AllowHardTerminate>
</Settings>
<Actions>
<Exec>
<Command>C:\Program Files\Java\jre6\bin\javaw.exe</Command>
<Arguments>main.MoveFile input.txt</Arguments>
<WorkingDirectory>C:\My Library</WorkingDirectory>
</Exec>
</Actions>
</Task>
There's more information about the XML schema here:
answered 2011-11-02T23:48:52.707