Gå til innhold

Importere planlagt oppgave via .bat


RMBB

Anbefalte innlegg

Jeg har laget noen planlagte oppgaver som jeg har eksportert til .XML dokumenter

Disse skal legges inn på mange maskiner og jeg har derfor lyst til å lage en .bat fil som imorterer dem.

Jeg forsøker å kjøre dette for å legge dem inn men får feilen:

FEIL: Forespørselen støttes ikke.

Noen som kan hjelpe?

schtasks /Create /S "system" /U %username% /P "*" /tn test  /XML "c:\test.xml" /f
Lenke til kommentar
Videoannonse
Annonse

Hvilken windows kjører du. Ser her:

 

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

 

at

 

 

 

/XML xmlfile

A value that creates a task from an XML file. This parameter can be combined with /RU and /RP switches, or with the /RP switch alone when the task XML already contains the principal.

Windows XP and Windows Server 2003: This option is not available.

Lenke til kommentar

Etter litt knoting viser det seg at /u og /p var problemet. Fjernet /s og byttet ut /U /P med /RU og /RP da fikk jeg importert:)

Hentet fra MS sine sider:

 

 

/u [domain\]user Runs the command with the permissions of the specified user account. By default, the command runs with the permissions of the user who is logged on to the computer that is running Schtasks.
/p password Specifies the password of the user account that you specified in the /u parameter. This parameter is required when the /u parameter is used.
/ru {[Domain\]User | "System"} Runs the tasks with the permission of the specified user account. By default, the task runs with the permissions of the user who is logged on to the computer that is running Schtasks.
/rp Password Specifies the password of the user account that is specified in the /ru parameter. If you omit this parameter when you specify a user account, Schtasks.exe prompts you for the password and obscures the text you type. Tasks that run with permissions of the NT Authority\System account do not require a password and Schtasks.exe does not prompt for one.

 

Endret av RMBB
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...