Bat file task popup, powerscript or autoHK?

Page 1 of 2 12 LastLast

  1. Posts : 194
    Win 7,8.1 ,10
       #1

    Bat file task popup, powerscript or autoHK?


    win10 up to date

    They changed something in windows a couple years ago, now my batch based tasks are all screwed up. I use taskill, wait/pause
    and exit command lines. So of course it creates a cmd window that never goes away now.


    What I need is a more in depth or option rich task utility, I'm a dumb ass(dyslexic) I can not do command line and scripts worth a damn but can fart around in a Gui window long enough to get crap done and not destroy the PC or universe..

    So since I can not use bath files anymore, least for not for dism/sfc, what I need is to have the task system itself do what I need the bat to do, mainly to turn on a program on as close to start up as it can, then kill and restart the program every hour.

    Yes the programs I use are buggy and either lock up or give out a ton of error windows(link bar spits out gdi errors when resolution changes or some back from the screens being off). SuperF4 will lock up now and then, I'm already angry enough when I am forced to use superf4 to kill a program(mostly becuse the screen is locked in full screen mode), I don't need another straw to break this camels back when windows has either broke or de evaluated it....and yes..... somehow it manages to get put out of admin mode but still works... thus why I use the task/bat to restart the program in admin mode every couple of hours.


    I guess the main reason why I can no longer us bat file tasks is it puts focus to the cmd window which is very distracting.... which it never use to do I been using these things for a decade now...

    Now from what I am read powerscript may be my hope, but unsure if it will popup the same as the cmd.exe. But I am bad as complicated script, that said I have used auto hotkey before, would that work, to just run a couple simple programs in admin mode every few hours with no popups?

    Also now that I think I'd rather use auto hotkey(if it will work) than bat to exe, as kaspersky and malwarebytes ate all my self made exe's twice already......


    also anyone know of a link bar alternative? Its a nice and simple program, but the gdi errors are annoying.
      My Computer


  2. Posts : 17,006
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    It's difficult to give precise answers to such vague yet interconnected statements.

    Please post the batch file you referred to in "I use taskill, wait/pause and exit" along with a text descriptions of what it is supposed to do, what it used to do and what it is doing now.

    Denis
      My Computer


  3. Posts : 194
    Win 7,8.1 ,10
    Thread Starter
       #3

    Try3 said:
    It's difficult to give precise answers to such vague yet interconnected statements.

    Please post the batch file you referred to in "I use taskill, wait/pause and exit" along with a text descriptions of what it is supposed to do, what it used to do and what it is doing now.

    Denis
    Ah my bad, its late, been in bed half the day due to sinus, blah.

    This will either will not run the program(can not find program), or for a few months a year or so ago, it ran the program but did not close the window, would not work with timeout or exit, so while the bat file gave no error it would not close automatically.

    I got so fed up with it I just added the damn thing to system32, it works now, but its not ideal, I don't want third party programs running from system32 or the appdata folder, those locations should be no fly zones for any third party app, much less appdata folder.... but the more I look around the more auto hot key seems like the best choice for my woes, it can start and end a program without loss of focus. I should be able to run it in admin mode, to cycle kill then run script.

    Old buggy bat, that worked for years
    --------------------------------
    @ echo off

    taskkill /f /IM SuperF4.exe

    B:\PROGRAMS\SuperF4\SuperF4.exe


    exit

    --------------------------------
    ==========================================================================

    This works fine, since I put supferf4 in system32, the loss of focus is annoyiong, I run the task every 2 hours
    -------------------------------
    @ echo off

    taskkill /f /IM SuperF4.exe

    SuperF4.exe

    /exit
    exit

    --------------------------------
    ==========================================================================
    this one works fine, but cmd takes focus away
    ------------------------


    taskkill /f /IM Linkbar64.exe

    C:\Users\username\Documents\Linkbar\Linkbar64.exe

    exit

    ---------------
      My Computer


  4. Posts : 17,006
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    I deal with focus by starting such batch files with a vbs 'caller'.
    Make Task scheduler run a batch file minimised and with a specific icon - TenForums


    I have never experienced a batch file that failed to obey the Exit command.
    I do not know what '/Exit' is intended to do.
    Exit is often unnecessary because batch files normally close automatically when their last command has been actioned.
    I suspect that the batch file is behaving correctly in that you are using it to run superf4 and that application does not tell the batch file it has executed until after it has been closed again - so the batch file is still waiting on the command and is not refusing to close.
    You can exploit these behaviours in some cases. I keep a batch file waiting while an application is running so that it can do what I want when the application is closed.


    It can take time for a program to quit so your old bugginess might be because superf4 is still in the process of closing when you try to start it [again].
    I deal with this by inserting a TimeOut command between the others e.g.
    Code:
    taskkill /f /IM SuperF4.exe
    TimeOut /T 3 
    B:\PROGRAMS\SuperF4\SuperF4.exe


    There are varying experiences but you might find that your batch file closes after its last command without any Exit if you use
    Start "" B:\PROGRAMS\SuperF4\SuperF4.exe
    instead of just the command itself.


    You might get some useful feedback on what the problems are by omitting
    @ echo off
    until all testing is finished.
    And, if the batch files are running in the background, do consider what benefit is there to @ echo off at all?

    To get useful feedback for a command containing Exit, you'd need to alter a shortcut used to start the batch file so its Target field was in the form
    MyBatchFile.bat >D:\Desktop\Commentary.txt
    so that commands & responses during its execution were redirected to a text file. Note that you cannot use that and see the batch file's progress & responses in a cmd window at the same time.



    Denis
    Last edited by Try3; 02 Mar 2023 at 04:55.
      My Computer


  5. Posts : 194
    Win 7,8.1 ,10
    Thread Starter
       #5

    Could kaspersky foul up something in windows to cause bat files to no wonky?? Or user/permission corruption to do that, once I put superf4 in system32 it worked fine.

    Oh...I have tried it without the @ echo line, also may has added / to exit, but that never seemed cause an issue, as the other bats work fine with and without the /.

    Tho I would not be surprised if I messed up another line, testing for a few hours straight without getting anywhere can lead you to make worse mistakes LOL

    Like I said things kinda work now , but cmd.exe stealing focus is something that's just to annoying to deal with and thees no way around it as far as I know, even if up for less than half a second it still steals focus and minimizes full screen stuff your working on sometimes(mainly older games), theres nothing you can do but make a c++ script and other crap, I'll just use auto hot key if I have to.
      My Computer


  6. Posts : 17,006
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    ZippyDSMlee said:
    cmd.exe stealing focus is something that's just to annoying to deal with and thees no way around it as far as I know
    Try3 said:
    I deal with focus by starting such batch files with a vbs 'caller'.
    Make Task scheduler run a batch file minimised and with a specific icon - TenForums
    Denis
      My Computer


  7. Posts : 17,006
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    If you had omitted the @echo off line
    ZippyDSMlee said:
    I have tried it without the @ echo line
    then you would have seen the error generated by /exit
    ZippyDSMlee said:
    also may has added / to exit, but that never seemed cause an issue
    All the best,
    Denis
      My Computer


  8. Posts : 194
    Win 7,8.1 ,10
    Thread Starter
       #8

    Try3 said:
    If you had omitted the @echo off line

    then you would have seen the error generated by /exit

    All the best,
    Denis
    The odd thing was, it ran fine for years. Tho focus was an issue, I had fewer batch tasks, like run dsim at start, with the SSD, I want to run dism 1-2 times a week at most so I have it going every 3 days. I know its not an ideal way to maintain system stability, but ever since I started using it 5-8ish years ago, I've had fewer BSOD, now I just worry about windose update eating something....

    I will try suggestions and get back to you, thank you so much for the help!
      My Computer


  9. Posts : 17,006
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    I had one BSOD about five or six years ago.
    I believe that my experience is normal.

    /exit never ran fine. It always generated an error.

    SuperF4 has not been updated since Windows 10 Version 1809. I have no idea if that is significant or not.


    Denis
      My Computer


  10. Posts : 194
    Win 7,8.1 ,10
    Thread Starter
       #10

    Try3 said:
    I had one BSOD about five or six years ago.
    I believe that my experience is normal.

    /exit never ran fine. It always generated an error.

    SuperF4 has not been updated since Windows 10 Version 1809. I have no idea if that is significant or not.


    Denis
    well with the /exit thing, it came into being when I spent hours trying to fix normal exit/timeout, it may be an error on my part but it only came into being because other things stopped working.

    SuperF4 runs fine 90% of the time, but after a few days of being on it can lock up and stop working, so when I am stuck in a full screen game that crashed, its hard to get out of it to end the process, as sometimes task manager will not popup over the game or full screen application.

    So having superF4 restart periodically helps ensure I am not forced to hard reboot.



    I did manage to get a bat file to run minimized.

    I have a side question, do you know of a way to put a bat file in the taskbar? I managed to get one in the star menu, but even a shortcut to it will not go in the taskbar, I really hate that steamlinks and batfiles no longer work in win10 taskbar, but are fine in win8 and win7.

    Also another dumb question if I may, is there a way to turn, run a task schedule into a proper shortcut?

    Again thank you for your time.
      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 10:53.
Find Us




Windows 10 Forums