• wkk@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    7 months ago

    https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa

    To run a batch file, you must start the command interpreter; set lpApplicationName to cmd.exe and set lpCommandLine to the following arguments: /c plus the name of the batch file.

    Because a batch file (.bat or .cmd) is basically a set of cmd.exe instructions I guess that’s why you can’t get away from it.

    And as if making sense of this CreateProcessA system call wasn’t funny enough, you also need to figure out how to safely prepare that lpCommandLine for it following all of cmd.exe’s weird escaping rules… lol

      • wkk@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        If you can avoid running batch files altogether then great, amazing. But there are projects out there using Rust that still depend on running those and that’s the focus of the issue… But yeah I cannot wait until the day I won’t hear about cmd.exe again.