#C++ Starting a process in APPDATA with CreateProcess

28 messages · Page 1 of 1 (latest)

simple wharf
#

New to CPP. The goal here is to start a process in APPDATA via SHGetFolderPath and CreateProcess, though im receiving errors that the program cannot find the file in "Program Files". Help would be appreciated.

Side note: This is not for any illegal activity, a brief explanation can be found below.

bronze turretBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

winged sinew
#

uhh I don't see any SHGetFolderPath usage

#

also, the tcsCommandLine looks a little sus, what are you trying to accomplish there?

simple wharf
#

Okay so this is a plugin for a game called Rocket league, this plugin can find live streamers in your match but i need to start an external program, now in order to start it, i have to write command in C++, but i can't do that because anytime a window opens up while playing rocket league it kicks you out of the game, so this is a solution to it.

simple wharf
pine fiberBOT
#
supsm
We do not help with anything pertaining to cheating/hacking/malware.

Aside from ethics and simply not caring for helping script kiddies, this content violates Discord's terms of service and we do not tolerate it.

See Also
winged sinew
#

this sounds like some sort of illegal modification

simple wharf
#

Nope, this is not any type of illegal activity

winged sinew
#

seems kinda sus tbh

simple wharf
#

Just explained to you why I'm using this solution

#

I get it, but this is the only way I can get my project to work

sturdy steeple
#

it’s not

#

He wants to check when streamers are online

#

you sure the CSIDL for Program Files is COMMON_APPDATA?

#

This might be getting the wrong version of program files

#

Could try this tbh

simple wharf
#

Wait, im trying to get the path for appdata

#

though an error returns with another path instead

#

for ex "Program files"... which I don't want

sturdy steeple
#

try this instead
std::filesystem::path path;
wchar_t* temp_path
auto szPath = SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &temp_path);

path = temp_path:
return path;

#

you can skip the std::file system if you want to do it in pre cpp17

simple wharf
#

AND, also how must I write the path for the tcsCommandLine section

sturdy steeple
#

path.wstring() + “…”

#

will have to change types around but

simple wharf
#
path::posix( const boost::filesystem::path& path )
{
    std::wstring temp = path.wstring();
    std::transform( temp.begin(), temp.end(), temp.begin(), detail::forslash<wchar_t>() );
    return temp;
}``` Pretty much in this format?
#

found this example online

bronze turretBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.