Windows 10: Problems automating a batch file with task scheduler

Discus and support Problems automating a batch file with task scheduler in Windows 10 Support to solve the problem; I want run this bat file from task scheduler @Rem %pf% expands to the right program location depending if it is x86 or x64 system @setlocal @set... Discussion in 'Windows 10 Support' started by Sxcd1, Jan 16, 2016.

  1. Sxcd1 Win User

    Problems automating a batch file with task scheduler


    I want run this bat file from task scheduler
    @Rem %pf% expands to the right program location depending if it is x86 or x64 system
    @setlocal
    @set pf=%ProgramFiles%
    @if not "[%ProgramFiles(x86)%]"=="[]" set pf=%ProgramFiles(x86)%

    @Rem %macropath% expands to the demo macros path
    @set macropath=%~dp0..\..\Macros\Demo


    "%pf%\Ipswitch\iMacros\iMacros.exe" -macro "D:\Users\W\Documents\iMacros\Macros\WN.iim"

    I have 2 problems that I need help with.
    1) If I run the batch file it works but closes the program when it's done. I need it to leave the program iMacros running.
    2) If I try to automate the time it runs with task scheduler if gives the error 0x1
    Other errors I've received trying different options are The requested operation requires elevation or The operator or administrator has refused the request, (0x800710E0)

    <?xml version="1.0" encoding="UTF-16"?>


    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
    <Date>2015-12-20T21:11:42.0831839</Date>
    <Author>W-PC\W</Author>
    <URI>\iMacro Watch Now</URI>
    </RegistrationInfo>
    <Triggers>
    <TimeTrigger>
    <StartBoundary>2016-01-17T10:40:00</StartBoundary>
    <Enabled>true</Enabled>
    </TimeTrigger>
    </Triggers>
    <Principals>
    <Principal id="Author">
    <UserId>S-1-5-21-138512411-977147251-668013927-1004</UserId>
    <LogonType>InteractiveToken</LogonType>
    <RunLevel>HighestAvailable</RunLevel>
    </Principal>
    </Principals>
    <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</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>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>"D:\Users\W\Documents\iMacros\iMacros2 .bat"</Command>
    <WorkingDirectory>D:\Users\W\Documents\iMacros\</WorkingDirectory>
    </Exec>
    </Actions>
    </Task>

    :)
     
    Sxcd1, Jan 16, 2016
    #1
  2. JipéJIPE Win User

    windows 10 How do you want to open this file Nothing works

    ok, problem solved.

    The problem was caused by a scheduled task having problems to run.

    That task should start a batch file every day at fixed time, but the name of the batch file was not compatible with the OS, so the task was restarting each time the PC was idle. The name of the batch file contained a space which has now been replaced with
    underscore.

    Changing the batch name solved the problem.
     
    JipéJIPE, Jan 16, 2016
    #2
  3. Tryx3 Win User
    Tryx3, Jan 16, 2016
    #3
Thema:

Problems automating a batch file with task scheduler

Loading...
  1. Problems automating a batch file with task scheduler - Similar Threads - Problems automating batch

  2. Issue running a Batch file from Win10 Task Scheduler.

    in Windows 10 Network and Sharing
    Issue running a Batch file from Win10 Task Scheduler.: Hi,I have created a Batch file to copy several files to my OneDrive system each day, so that I can access them if I'm not with my laptop. The script refers directly to OneDrive via c:\users\...The batch file runs within a CMD window with and without Admin privileges. But it...
  3. Issue running a Batch file from Win10 Task Scheduler.

    in Windows 10 Gaming
    Issue running a Batch file from Win10 Task Scheduler.: Hi,I have created a Batch file to copy several files to my OneDrive system each day, so that I can access them if I'm not with my laptop. The script refers directly to OneDrive via c:\users\...The batch file runs within a CMD window with and without Admin privileges. But it...
  4. Issue running a Batch file from Win10 Task Scheduler.

    in Windows 10 Software and Apps
    Issue running a Batch file from Win10 Task Scheduler.: Hi,I have created a Batch file to copy several files to my OneDrive system each day, so that I can access them if I'm not with my laptop. The script refers directly to OneDrive via c:\users\...The batch file runs within a CMD window with and without Admin privileges. But it...
  5. Task Scheduler - Batch File

    in Windows 10 Gaming
    Task Scheduler - Batch File: I am attempting to use Task Scheduler to run a batch file automatically every day. I am following instructions that I found on the Web. As far as I can tell I have set up Task Scheduler correctly, the only problem being that it doesn't run! I have uploaded screenshots of the...
  6. Task Scheduler - Batch File

    in Windows 10 Software and Apps
    Task Scheduler - Batch File: I am attempting to use Task Scheduler to run a batch file automatically every day. I am following instructions that I found on the Web. As far as I can tell I have set up Task Scheduler correctly, the only problem being that it doesn't run! I have uploaded screenshots of the...
  7. What Could Be Disabling Batch Files Scheduled in Task Scheduler?

    in Windows 10 Support
    What Could Be Disabling Batch Files Scheduled in Task Scheduler?: I'm using Win10 Pro 2004. I go to Win-R > taskschd.msc > Task Scheduler Library. I see a number of batch files that I have scheduled to run at various times. I see that today, like yesterday, their status is Disabled. Yesterday, when I saw that, I right-clicked > Enable. But...
  8. use Task Scheduler to start batch file, minimized?

    in Windows 10 Support
    use Task Scheduler to start batch file, minimized?: I have already tried to find the solution using google, but literally none of them worked! At one point I edited the file/folder names, and changed the locations to those in the "solutions" but even that didn't work! You are my last hope! is there any way, any at all, you...
  9. Invoke scheduled task from batch?

    in Windows 10 Support
    Invoke scheduled task from batch?: Is there any way to invoke a scheduled task from a script? I know the tasks can be manually invoked from the Task Scheduler's GUI so maybe there's a way to do it programmatically. Yes? 165093
  10. Start Batch File Minimized via Task Scheduler

    in Windows 10 Support
    Start Batch File Minimized via Task Scheduler: I have a batch file scheduled to run in Task Scheduler in Windows 10. The batch file runs on schedule, but it opens a full CMD window. I have tried entering variations on start /min in the Task Scheduler properties, but these seem to have no effect. The particular batch...

Users found this page by searching for:

  1. windows 10 @setlocal