Possibly invalid drive letter for icacls / powershell calls on Windows

Checking the ZT source repo I found that the Windows system drive letter is hardcoded in many places, e.g.

if (CreateProcessA(NULL, (LPSTR)(std::string(“C:\Windows\System32\icacls.exe "”) + path + “" /remove:g Everyone /t /c /Q”).c_str(), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInfo)) {

Shouldn’t this use the Windows System32 directory? It is possible to have Windows installed on a different drive, and worse, to have an old version of Windows (7 or 8.1) at drive letter C:, leading to wrong, old executables being called inadvertently this way, as far as I can see.
I happen to have seen a number of old PC’s where Windows 10 was added on a separate partition (e.g. drive D:) where drive C: actually contains an old (pre-10) Windows installation.

IMHO, it should be fairly easy to obtain the actual, correct location for \Windows\System32 and modifying the CreateProcess calls to Windows executables accordingly.
If I’m misinterpreting this and Windows is already magically changing the location when CreateProcess gets called, I apologize in advance, being a Linux developer myself :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.