Skip to content

Instantly share code, notes, and snippets.

@gocha
Created January 18, 2018 04:02
Show Gist options
  • Save gocha/959b01fdda61c42a355f42230d6e5e68 to your computer and use it in GitHub Desktop.
Save gocha/959b01fdda61c42a355f42230d6e5e68 to your computer and use it in GitHub Desktop.
Cygwin: cmd.exe launcher (without quoting)
// runwin32.exe dir "\"C:\Program Files\\\""
#include <stdio.h>
#include <stdlib.h>
#include <string>
using std::string;
int main(int argc, char *argv[]) {
string command("cmd /c");
for (int i = 1; i < argc; i++) {
command += " ";
command += argv[i];
}
return system(command.c_str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment