Start Batch File Minimized via Task Scheduler

Page 1 of 2 12 LastLast

  1. Posts : 5
    Windows 7 and 10
       31 Jan 2018 #1

    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 file opens and then pauses at a PAUSE statement, waiting for user response. I want it to start minimized partly because, when it opens to a full CMD window, it captures keystrokes, if I happen to be typing. In that case, the newly opened batch file blows past the pause and proceeds with its next steps. I don't want that to happen.

    Possibly I am using the wrong term. When I say "minimized," I mean that the batch file will be visible as an item on the taskbar, but its window will not open up onscreen. To access the batch file, I will have to coolswitch to it or click on its taskbar icon.

    So the question is, how can I start this batch file minimized, in the sense that it will open as a taskbar icon but not as a full CMD window?
      My ComputerSystem Spec

  2.    31 Jan 2018 #2

    Have tried below command from Task Scheduler.


    Code:
    cmd.exe /k start /min myfile.bat
      My ComputerSystem Spec


  3. Posts : 5
    Windows 7 and 10
    Thread Starter
       31 Jan 2018 #3

    Thanks for taking a stab at it. But no, I can't seem to make that work in any combination. Most combinations (e.g., putting full path plus filename in the "Start in" field) run nothing. The most response I got was an error: "It appears as though arguments have been included in the Program text box." Do you have more specific knowledge as to which items should go in the Arguments and Start In fields?
      My ComputerSystem Spec

  4.    31 Jan 2018 #4

    Let me test the command and i will let you now.
      My ComputerSystem Spec

  5.    31 Jan 2018 #5

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")obj = WshShell.Run("path to batch file.bat", 2)set WshShell = Nothing
    That will work in a .vbs file.
      My ComputerSystem Spec

  6.    31 Jan 2018 #6

    If this still comes up inoperable, you may want to try a third party tool. WinAutomation is very good, but I don't know if it will run minimized or not. A 2009 forum thread there discusses several ways to make it run minimized, but that's pretty old now. Check it out at WinAutomation - Smart Macro Recorder, Web Automation Recorder and more.
    HTH,
    --Ed--
      My ComputersSystem Spec

  7.    31 Jan 2018 #7

    How about below script?


    Code:
    Echo @echo off > %tmp%\Test.bat
    
    Echo Echo testing >> %tmp%\Test.bat
    
    Echo pause >> %tmp%\Test.bat
    
    
    cmd.exe /c start /min %tmp%\Test.bat
    
    Exit
      My ComputerSystem Spec

  8.    31 Jan 2018 #8

    Nircmd is another third party application that you can use to run it minimized.
      My ComputerSystem Spec

  9. topgundcp's Avatar
    Posts : 2,438
    Ubuntu14.04x64 MintMate17x64 Win10Prox64
       31 Jan 2018 #9

    Create a shortcut of the bat file. Right click->Properties and set to rum minimize. Set the schedule to run the Shortcut instead.
      My ComputerSystem Spec


  10. Posts : 999
    Windows 10 Home x64 and Pro x86
       01 Feb 2018 #10

    Use this procedure Make Windows 10 Task scheduler run a batch file minimised and with a specific icon - MSA Forum article

    I wrote that article but post any questions here not there as I do not contribute to that forum anymore.

    Denis
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Related Threads
Here's a little script to make a backup of 2 directories: ::can't copy Opera data while Opera is running taskkill /im opera.exe robocopy c:\all e:\Bobback\All /mir robocopy c:\Users\Bob\AppData\Roaming e:\Bobback\Roaming /mir
Hello, I want to start an EXE program Minimized, or better yet, hidden (so I don't see its program in the Taskbar) only when the computer comes back from Hibernate. (This EXE file does the command to delete the hiberfil.sys file.) It only runs for a...
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 ""=="" set pf=%ProgramFiles(x86)% Rem %macropath% expands to the demo...
Hello Community! I'm trying to get BBC iPlayer downloads to start automagically at 2100 so that it can start downloading Doctor Who. I'd like it to start minimized, but I am unsure how to do so. In addition to this, does anyone know if there...
I've been trying to figure this out for a while now and I can't. I've looked at tons of small tips online to get this working but it doesn't work at all. I have a batch file which causes various programs to start when opened. However, one of them...
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 11:10.
Find Us