FILE *fp = nullptr; auto backup = _dup(_fileno(stderr)); fopen_s(&fp, "nul", "w"); _dup2(_fileno(fp), _fileno(stderr)); //ここの間、stderrへの出力は無へと消える(ファイル名nulは無への出力) _dup2(backup, _fileno(stderr)); ::fclose(fp); http://d.hatena.ne.jp/butyricacid/20111014/1318562989 http://www.4gamer.net/games/999/G999904/20130823022/ https://qiita.com/jiroshino/items/14d9cd03d7e762198abc https://www.slideshare.net/okum