How i can put a delay in a open command?



  • Hello everyone.

    I've create a routine on my alexa to open a lot of stuffs on my pc. So for exemple, I'm trying to open my steam and my counterstrike, the problem is my csgo open so fast, and my faceit anti-cheat or gamesgclub don't have time to start.

    So I need to put a delay on my csgo command to get in the time to my anti cheat open and sync and be ready to open csgo, I think 5 - 10 seconds is good.

    My routine in alexa is:

    Open Gamersclub ("C:\Users\KRATUUZ\AppData\Local\Programs\gcac-launcher\Gamers Club AC Launcher.exe")
    Open Steam ("C:\Program Files (x86)\Steam\steam.exe")
    Close Wallpaper (taskkill /f /im wallpaper32.exe /t)
    Close TaskbarX (taskkill /f /im TaskbarX.exe /t)
    Open Discord (C:\Users\KRATUUZ\AppData\Local\Discord\Update.exe --processStart Discord.exe)
    Open CS:GO ("C:\Program Files (x86)\Steam\steam.exe" "steam://rungameid/730")



  • @Lucas-Marcelino, you could put all of those commands in one batch file script called c:\scripts\games.bat like this:

    echo Running games script.
    "C:\Users\KRATUUZ\AppData\Local\Programs\gcac-launcher\Gamers Club AC Launcher.exe"
    "C:\Program Files (x86)\Steam\steam.exe"
    taskkill /f /im wallpaper32.exe /t
    taskkill /f /im TaskbarX.exe /t
    C:\Users\KRATUUZ\AppData\Local\Discord\Update.exe --processStart Discord.exe
    timeout 5
    "C:\Program Files (x86)\Steam\steam.exe" "steam://rungameid/730"
    echo Done.
    

    And make one command that runs it like this:
    71e68976-39d5-42b9-a8bc-51bd225ead72-image.png



  • Heyyyyy much thanks! I made some modifications on your code: (I need to put to run with admin powers)

    @echo off
    
    if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
    
    echo Running gamersclub script.
    "C:\Windows\System32\ctfmon"
    "C:\Users\KRATUUZ\AppData\Local\Programs\gcac-launcher\Gamers Club AC Launcher.exe"
    "C:\Program Files (x86)\Steam\steam.exe"
    taskkill /f /im wallpaper32.exe /t
    taskkill /f /im TaskbarX.exe /t
    "C:\Users\KRATUUZ\AppData\Local\Programs\Opera GX\launcher.exe" "https://www.gamersclub.com.br/lobby"
    timeout 15
    "C:\Program Files (x86)\Steam\steam.exe" "steam://rungameid/730"
    timeout 15
    "C:\Users\KRATUUZ\AppData\Local\Discord\app-1.0.9002\Discord.exe"
    timeout 15
    quit
    
    

    The new problem is my discord reporting something on my cmd, I put a timout in the end as well, but didn't resolve the problem

    9a2dc9c5-f25a-4976-a3a3-11fc66b7c7b8-image.png

    I hope you can help me once again XD.



  • @Lucas-Marcelino, I saw the same thing when I tried running Discord.exe like you did.

    If you run discord like this you'll avoid that:

    "C:\Users\KRATUUZ\AppData\Local\Discord\Update.exe" --processStart Discord.exe

Log in to reply