Pregunta

I need to setup a Window sheduled task passing in the lauch folder, but looking at the official documentation i can't find how to do that.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx

In the Windows Task panel it is a field named "Start in"

This is my actual command

schtasks /create /tn "LogicalDOC backup simple" /tr "C:\LogicalDOC-btool3\backup.bat" /sc daily /st 02:00:00

Actually this command doesn't work because it must be executed from folder C:\LogicalDOC-btool3

Here is an image of the Task Action properties that actually work, but my need is to setup it from command line or by using something different (VB script or Powershell script)

enter image description here

UPDATE: I tried to create the task using the /V1 option and I have to say that the working directory (Start in) has been populated, only that the system required me username and password of the user. I've followed the suggestion of this post Specifying the running directory for Scheduled Tasks using schtasks.exe

I'd like to know if it's possible to specify, during task creation, to execute by the current user without passing it in the launch options, or if it's possible to run the task as SYSTEM user

¿Fue útil?

Solución

as you have created the task in the UI ( your screenshot), you can export it's properties to XML (right clik, export). Then you van import this xml using schtasks /create /XML path/to/taskprop.xml ...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top