当前位置: 首页> 打印机> 正文

爱普生清零软件代码

#include

#include

int main()

{

char cmd[100];

int i;

//检查打印机的状态

sprintf(cmd, “lpstat -p”);

system(cmd);

//删除打印队列中的所有任务

sprintf(cmd, “cancel -a”);

system(cmd);

//清空Printer选择,方法一

sprintf(cmd, “lpoptions -d”);

system(cmd);

//清空Printer选择,方法二

for(i=1;i<=10;i++){

sprintf(cmd, "lpoptions -p Printer-%d -X", i);

system(cmd);

}

//清空Printer选择,方法三

sprintf(cmd, "lpoptions -r >/dev/null”);

system(cmd);

//检查打印机状态

sprintf(cmd, “lpstat -p”);

system(cmd);

return 0;

}

最新文章