Powershell scripting Discord give an error

asked 2021-11-02T22:31:57.507+00:00
Juan Carlos 1 Reputation point

So the matter is simple, i have design (raw) a ps script to start a few apps (discord and steam). When i launch them apart it seem ok, but together (or other app) it crashes Discord, making it update or somehow blocking it 145931-image.png

So, im not a pro in ps but i want to know the problem to solve it now and in the future.

(The image is reduce because it contains personal folders and info)

Thanks for the help!


Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,618 questions
{count} votes

3 answers

Sort by: Most helpful
  1. answered 2021-11-02T23:09:51.187+00:00
    MotoX80 23,491 Reputation points

    Without a specific error message, without a script to look at, without an error log to look at, and only a small image that's been cut down to not show much of anything..... why sure, forum users will know exactly what your problem is.

    I'll take an educated guess and suggest that you could add in a delay between each app that you start in order to allow each app time to initialize. Start any database first, then the web/application programs.

    Start-Sleep -Seconds 30

    If Discord (whatever that is) still crashes, then search the Discord documentation and find out where it stores it's log files. There should be some error entry in it's log.

  2. answered 2021-11-03T01:28:48.31+00:00
    Rich Matheisen 34,951 Reputation points

    If it crashed there's probably a dump file. Contact the app's support folks and have them look at it. There's probably some sort of race condition, or some developer neglected to lock a shared resource.

    For now, follow the advice @MotoX80 offered and put a small delay between each app's startup. How long that might be depends on what the problem is. You'll probably have to experiment to find the shortest delay that works consistently.

  3. answered 2021-11-04T13:08:19.693+00:00
    MotoX80 23,491 Reputation points

    Another educated guess..... add a WorkingDirectory parameter to the start-process. That way when the processes run, if they try to access a file using an unqualified name like "config.ini" and not a fully qualified name like "C:\Program Files (X86)\Steam\Config.ini" they should be able to find their files.

    Also start Powershell with "Run as administrator".

    Start-Process  "C:\Program Files (X86)\Steam\Steam.exe" -WorkingDirectory "C:\Program Files (X86)\Steam\"
    Start-Sleep -Seconds 10
    Start-Process  "C:\Program Files (X86)\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe" -WorkingDirectory "C:\Program Files (X86)\Epic Games\Launcher\Portal\Binaries\Win32"
    Start-Sleep -Seconds 10
    Start-Process  "C:\Program Files (X86)\Jcu\AppDate\Local\Discord\app-1.0.9003\Discord.exe" -WorkingDirectory "C:\Program Files (X86)\Jcu\AppDate\Local\Discord\app-1.0.9003"
    No comments