Windows 10: Start Batch File Minimized via Task Scheduler

Discus and support Start Batch File Minimized via Task Scheduler in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by raywood, Jan 30, 2018.

  1. raywood Win User

    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?

    :)
     
    raywood, Jan 30, 2018
    #1
  2. Tryx3 Win User
    Tryx3, Jan 30, 2018
    #2
  3. 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 30, 2018
    #3
  4. Start Batch File Minimized via Task Scheduler

    Have tried below command from Task Scheduler.


    Code: cmd.exe /k start /min myfile.bat[/quote]
     
    FreeBooter, Jan 30, 2018
    #4
  5. raywood Win User
    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?
     
    raywood, Jan 30, 2018
    #5
  6. Let me test the command and i will let you now.
     
    FreeBooter, Jan 30, 2018
    #6
  7. Code: Set WshShell = WScript.CreateObject("WScript.Shell")obj = WshShell.Run("path to batch file.bat", 2)set WshShell = Nothing[/quote] That will work in a .vbs file.
     
    cyberrufus, Jan 30, 2018
    #7
  8. EdTittel Win User

    Start Batch File Minimized via Task Scheduler

    EdTittel, Jan 30, 2018
    #8
  9. 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[/quote]
     
    FreeBooter, Jan 30, 2018
    #9
  10. Nircmd is another third party application that you can use to run it minimized.
     
    cyberrufus, Jan 30, 2018
    #10
  11. topgundcp Win User
    Create a shortcut of the bat file. Right click->Properties and set to rum minimize. Set the schedule to run the Shortcut instead.
     
    topgundcp, Jan 30, 2018
    #11
  12. Try3 Win User
  13. raywood Win User

    Start Batch File Minimized via Task Scheduler

    Thanks for your replies. Sad to say, I have never learned VBS, and can't make that investment now, so the VBS suggestions elude me. The Nircmd and shortcut suggestions are familiar, but as far as I can tell they run the batch file invisibly, so that I can't bring it back to fullscreen by coolswitching or clicking on a taskbar icon. I looked at WinAutomation, but it seems the price is $400.

    FreeBooter: interesting script. I'm not sure I get it, though. The script issues commands that, collectively, construct a batch file and then run it minimized. So I would rewrite my batch files to consist of similar commands. What's running, ultimately, is not the commands presently found in my batch file. What's running is the temporary batch file constructed from the lines in my rewritten batch files. It's credible, but damn ungainly.

    Could I do something similar with TYPE or COPY commands that would stick the contents of a normal-looking batch file into a new, temporary batch file that CMD /C would then run minimized? It seems like this shouldn't be hard, but I'm tired and I can't quite wrap my head around it.

    Thanks again, one & all ...
     
    raywood, Feb 1, 2018
    #13
  14. Batch script i posted will Echo all your code line by line to Temp.bat and execute it i know you will have to use Echo command front of all the single codes to copied into Temp.bat file that's best i can think of it for now maybe you can use For command to Echo your codes to Temp.bat file. Make sure to not to Echo cmd.exe /c start /min %tmp%\Test.bat to Temp.bat file. If i come up with something else i let you know.
     
    FreeBooter, Feb 1, 2018
    #14
  15. Try3 Win User
    Raywood,

    The procedure I posted a link to takes you through the whole thing and you will not need to learn VBS or anything else. And you will not need to spend anything.

    Denis
     
Thema:

Start Batch File Minimized via Task Scheduler

Loading...
  1. Start Batch File Minimized via Task Scheduler - Similar Threads - Start Batch File

  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. Start VM via bat file in Windows Task Scheduler

    in Windows 10 Virtualization
    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...
  8. Problems automating a batch file with task scheduler

    in Windows 10 Support
    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...
  9. Batch file start program minimized

    in Windows 10 Support
    Batch file start program minimized: Here's a little script to make a backup of 2 directories: Code: ::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 ::restart Opera minimized start...
  10. Batch file - Unable to start a program minimized

    in Windows 10 Support
    Batch file - Unable to start a program minimized: 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 always appears above the rest...