C
C#2y ago
Jana ♡

❔ Proplem in process start

im using the code :
private void button1_Click(object sender, EventArgs e)
{
string Game = @"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe";
Process.Start(new ProcessStartInfo { FileName = Game, UseShellExecute = true });
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
string Game = @"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe";
Process.Start(new ProcessStartInfo { FileName = Game, UseShellExecute = true });
this.Close();
}
Hod2.exe (The House of the dead 2 game) must be opened but it only crashes ; / but when i run the game without the button1 it works well
26 Replies
Jana ♡
Jana ♡OP2y ago
yo
ACiDCA7
ACiDCA72y ago
*ignore even harder*
Jana ♡
Jana ♡OP2y ago
im using the code :
private void button1_Click(object sender, EventArgs e)
{
string Game = @"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe";
Process.Start(new ProcessStartInfo { FileName = Game, UseShellExecute = true });
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
string Game = @"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe";
Process.Start(new ProcessStartInfo { FileName = Game, UseShellExecute = true });
this.Close();
}
Hod2.exe (The House of the dead 2 game) must be opened but it only crashes ; / but when i run the game without the button1 it works well please help me fix it guys ;-;
Anton
Anton2y ago
use backslashes in the path
Jana ♡
Jana ♡OP2y ago
\ this ?
Anton
Anton2y ago
yes
Jana ♡
Jana ♡OP2y ago
okay and ?
Anton
Anton2y ago
try it
Jana ♡
Jana ♡OP2y ago
will it work ? :<
Anton
Anton2y ago
idk try
Jana ♡
Jana ♡OP2y ago
i did result : (crashes) : /
Anton
Anton2y ago
try starting it in the directory where the exe is
Jana ♡
Jana ♡OP2y ago
wdym ?
Anton
Anton2y ago
working directory
Jana ♡
Jana ♡OP2y ago
the directory is working
Anton
Anton2y ago
read online what's the working directory of a process
Jana ♡
Jana ♡OP2y ago
button1.click = crashes but when i open it without the button it works well ; / didt help : /
Anton
Anton2y ago
what did you do
Jana ♡
Jana ♡OP2y ago
😦 i really need to fix it program works well but it crashes when open it via button in c#
Anton
Anton2y ago
what's the exception that's thrown say?
sinaesthetic
sinaesthetic2y ago
Try quoting the path?
string Game = @"\"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe\""
string Game = @"\"C:/TrexLauncher (the House Of The Dead 2)/Launcher/Game/The House of The Dead 2/Hod2.exe\""
Jana ♡
Jana ♡OP2y ago
yes i did man
sinaesthetic
sinaesthetic2y ago
what i pasted is different from what you have
Jana ♡
Jana ♡OP2y ago
didnt work
Anton
Anton2y ago
they're using a raw string you escape quotes with "" there
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server