question

JuanCarlone-3260 avatar image
0 Votes"
JuanCarlone-3260 asked MotoX80 answered

Powershell scripting Discord give an error

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!



145848-image.png


windows-server-powershell
image.png (7.6 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

To complete the info (sorry for you all) im gonna post the script. This is

146275-image.png

Another curious thing that has taken my attention is that, running it on PS ISE, doesn't create a problem, it just start smoothly.
The second curious thing is that, discord alone starts fine, Steam and Epic (both game platforms) on their own start also fine, but together they "crash". It isnt really a crash.
It is just that the app keeps hanged over the PS windows created in the process.

So im gonna show the new script and the complete error.
146257-image.png

And the error
146258-image.png

So the thing is, when i close the PS windows (which happens automatically alone) it closes the app, so the script isnt valid anymore.

I apologize again for the bad explanation and the lack of info.
Again, thank you all


0 Votes 0 ·
image.png (15.6 KiB)
image.png (16.5 KiB)
image.png (57.1 KiB)

Just to provide a way to see if this is specific to PowerShell, or perhaps to the environment that the other Windows inherit from the window in which you run the script, put this into a .BAT file and run the .BAT from CMD.exe.

 start "" "C:\Program Files (X86)\Steam.exe"
 start "" "C:\Program Files (X86)\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe"
 start "" "C:\Program Files (X86)\Jcu\AppDate\Local\Discord\app-1.0.9003\Discord.exe"

Can you identify which device on your system is associated with the GUID in the error message?

0 Votes 0 ·

Are you opening Powershell.exe or Powershell_ISE.exe with "Run as Administrator"? If not, then try that.

It isnt really a crash. It is just that the app keeps hanged over the PS windows created in the process.

Sorry, I don't understand what that means.

I tend to think that you will have better luck asking for help in a Discord or Steam forum. Your questions aren't really Windows OS specific, they are more application related. Typically when someone asks a question, we try to recreate the environment so that we can run tests on our machines. But none of those apps are Microsoft apps, so forum users don't typically have them installed on our PC's. Unless you find another gamer on this forum, most of us seem to have business backgrounds, and our expertise is with Windows features and programs.

It's not that we don't want to help you, it's just that we don't have the same environment where we can recreate your problem to try to find a solution.

From a standard application troubleshooting perspective, most apps will either create their own log files or write to the Windows Application event log. Your best bet is to find and analyze the errors wherever the app logs it errors.

In the image you posted, it would appear that you have some kind of issue with an audio device, but I have no idea what to tell you to look for. Is there some audio configuration setting in it's configuration files?




0 Votes 0 ·
MotoX80 avatar image
0 Votes"
MotoX80 answered JuanCarlone-3260 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

'Discord' is a VoIP, IM, and distribution platform. If he's running Steam too he's probably running games.

0 Votes 0 ·

Sorry for the lack, i updated the previous info for you to look.
With the sleep it still have the "error".

Thanks

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered JuanCarlone-3260 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry again, i updated the info, as you say, i tried the sleep method but it keeps hanged to the PS windows, so nothing new.

Thanks

0 Votes 0 ·
MotoX80 avatar image
0 Votes"
MotoX80 answered

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"
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.