string sCommand = "ipconfig /all >C:\Users\administrator\AppData\Roaming\DBank\ClickUp\Log\test.log";
system(sCommand.c_str());为什么有的电脑可以输出DNS到这个文件夹  有的却不可以

解决方案 »

  1.   

    C:\Users\administrator\AppData\Roaming\DBank\ClickUp\Log
    这个目录是否存在,然后看是否命令执行成功了
      

  2.   

    路径改为 C:\test.log 就OK  这是为什么啊
      

  3.   


    是管理员账户 
    C:\test.log OK   但是C:\Documents and Settings\test.log 就失败 
      

  4.   

    C:\Documents and Settings\test.log 就失败
     权限问题目录C:\Documents and Settings 手工都打不开,何况用程序打开
      

  5.   

    string sCommand = "ipconfig /all >C:\\Users\\administrator\\AppData\\Roaming\\DBank\\ClickUp\\Log\\test.log";

    string sCommand = "ipconfig /all >C:/sers/administrator/AppData/Roaming/DBank/ClickUp/Log/test.log";
      
      

  6.   


    我手工可以打开的只是用system写不到那个路径下的文件里我写到C盘下  然后读出来 再用ofstream写文件到那里就可以了