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. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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
  7. Task scheduler Automated Email Notification-Success/Failure

    in Windows 10 Customization
    Task scheduler Automated Email Notification-Success/Failure: Hi Experts, I have created one task in task scheduler and it will run daily 5AM PST. I would like to create an email notification when job job failed. Is it possible to achieve in windows server 2016? Kindly let me know if you have any solution. Thanks in advance....
  8. Parallel batch jobs in one scheduled task

    in Windows 10 Support
    Parallel batch jobs in one scheduled task: Parallel batch jobs in one scheduled task hi, This should be an easy answer. I want to create one scheduled task, it will be called "CLEAR_PHOTOSBYDATE", see attached pic or (approximate example, not literal job...yet)...
  9. Task Scheduler and Bat File Problem

    in Windows 10 Support
    Task Scheduler and Bat File Problem: Hi, Not sure which forum to post this in, but hopefully someone has some insight and can help me with this. I have a simple .bat file that stops my media server, creates an archive of a folder (for backup purposes), and then starts the media server again. It works...
  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