Start VM via bat file in Windows Task Scheduler


  1. Posts : 2
    Windows 10Pro x64
       #1

    Start VM via bat file in Windows Task Scheduler


    I'm attempting to start a VM from a bat file with Windows 10 Task Scheduler.

    The bat by itself and the script via CMD execute correctly, though I cannot get it to run as a bat in Task Scheduler. I've tried different configurations, directly from a CMD, etc. Interesting note...my suspend VM task executes from a similar bat file in Task Scheduler.

    Script:
    Code:
    vmrun start "G:\Virtual Machines\SETI\SETI.vmx"

    Task Scheduler Task:
    Code:
    <?xml version="1.0" encoding="UTF-16"?>  
    <Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">  
      <RegistrationInfo>  
        <Date>2018-05-11T17:16:20.4811409</Date>  
        <Author>Computer\User</Author>  
        <URI>\Start SETI VM</URI>  
      </RegistrationInfo>  
      <Triggers>  
        <CalendarTrigger>  
          <StartBoundary>2018-05-12T13:00:00</StartBoundary>  
          <Enabled>true</Enabled>  
          <ScheduleByDay>  
            <DaysInterval>1</DaysInterval>  
          </ScheduleByDay>  
        </CalendarTrigger>  
      </Triggers>  
      <Principals>  
        <Principal id="Author">  
          <UserId>S-1-5-21-3014447340-4107568225-1465194199-1001</UserId>  
          <LogonType>Password</LogonType>  
          <RunLevel>LeastPrivilege</RunLevel>  
        </Principal>  
      </Principals>  
      <Settings>  
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>  
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>  
        <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>  
        <AllowHardTerminate>true</AllowHardTerminate>  
        <StartWhenAvailable>false</StartWhenAvailable>  
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>  
        <IdleSettings>  
          <StopOnIdleEnd>true</StopOnIdleEnd>  
          <RestartOnIdle>false</RestartOnIdle>  
        </IdleSettings>  
        <AllowStartOnDemand>true</AllowStartOnDemand>  
        <Enabled>true</Enabled>  
        <Hidden>false</Hidden>  
        <RunOnlyIfIdle>false</RunOnlyIfIdle>  
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>  
        <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>  
        <WakeToRun>false</WakeToRun>  
        <ExecutionTimeLimit>PT1H</ExecutionTimeLimit>  
        <Priority>7</Priority>  
        <RestartOnFailure>  
          <Interval>PT1M</Interval>  
          <Count>3</Count>  
        </RestartOnFailure>  
      </Settings>  
      <Actions Context="Author">  
        <Exec>  
          <Command>D:\Documents\Scripts\vmware-start-SETI.bat</Command>  
        </Exec>  
      </Actions>  
    </Task>
      My Computer


  2. Posts : 2
    Windows 10Pro x64
    Thread Starter
       #2

    Making some headway...

    Task works if I run it as "Run only when user is logged on", but not under "Run whether user..."

    I have "Run with highest privileges" enabled.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:40.
Find Us




Windows 10 Forums