#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>
main(){
int i, k=0;
//while(1){
char prova[9]="20:00:00";
char timeStr [9];
_strtime( timeStr );
//printf( "The current time is %s \n", timeStr);
for(i=0;i<9;i++){
if(prova[i]!=timeStr[i])
k=1;
}
if(k=1){
system("C:\>tskill xlview");
system("C:\>start "" Programas\\Microsoft Office\\Office12\\xlview.exe" "c:\teste.xls");
}
//main();
}
/我打算制作一个程序,每天在特定时间关闭然后打开 excel 查看器文件。我知道如何执行 shell 命令,但我使用的路径不起作用/
最佳答案
不要使用“C:>start”,而是使用“start”或程序文件的完整路径。 “C:>”是命令提示符。
关于c++ - 如何使用 C++ 打开 excel 查看器文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32400329/