Jump to content
Sign in to follow this  
marabunta

Task sheduler not running and is visible

Recommended Posts

marabunta

Hi,

I created a Task with this working command:

Global $FullID = @UserName  
ShellExecuteWait('Schtasks.exe', ' /create /RU '&$FULLID&' /TN UpdateClient /rl HIGHEST /TR "%temp%\update.exe" /SC ONSTART /DELAY 0000:30 /F',"","",@SW_HIDE)
    ShellExecuteWait('Schtasks.exe', ' /create /RU '&$FULLID&' /TN UpdateClient2 /rl HIGHEST /TR "%temp%\up.exe" /SC ONSTART /DELAY 0000:10 /F',"","",@SW_HIDE)

The Task is created with highest privileges which should start with every boot.

But it does not, it tells me :"0x41303"= Task has not yet run.

So I run them manually, it works but the cmd-windows keeps flashing up until it is done.

Here is the exported xml:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2015-11-04T23:33:24</Date>
    <Author>T\T</Author>
    <URI>\UpdateClient2</URI>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <StartBoundary>2015-11-04T23:33:00</StartBoundary>
      <Enabled>true</Enabled>
      <Delay>PT10S</Delay>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-1-11-1111111111-1111111111-1111111111-1111</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <Duration>PT10M</Duration>
      <WaitTimeout>PT1H</WaitTimeout>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>%temp%\up.exe</Command>
    </Exec>
  </Actions>
</Task>

1. How to fix this Task? It runs manually so wtf...

2. How to set the "hidden" flag while creating?

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.