博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
后台执行格式化的例程
阅读量:4228 次
发布时间:2019-05-26

本文共 616 字,大约阅读时间需要 2 分钟。

#include "stdafx.h"
#include "windows.h"
#include "shellapi.h"
#include <string>
#include <iostream>
using namespace std;
int main()
{
    /*
    system("format G: /q /y");
    system("format G: /q /y");
    */
    /*
    char *FormatW2K = "CMD.EXE";
    char *FormatW2KParam = "/C //"format.com h:/force/q/u/x/V:MISC//"";
    */
    string strDsk;
    cout << "Please enter diskname : ";
    cin >> strDsk;
    string strCMD = "CMD.EXE";
    string formatParameter = "/C /"format.com ";
    formatParameter += strDsk;
    formatParameter += ":/force/q/u/x/V:MISC/"";
    //在后台执行格式化命令
    ShellExecute(NULL, "open", strCMD.c_str(), formatParameter.c_str(), NULL, SW_HIDE);
    return 0;
}

转载地址:http://ghdqi.baihongyu.com/

你可能感兴趣的文章
增加windows下Tomcat运行时的内存
查看>>
tomcat群集中session共享的几个方案
查看>>
查找google谷歌北京IP地址的方法
查看>>
本科大数据专业该怎么上?
查看>>
云创大数据1+X大数据应用部署与调优职业技能等级证书预申报正式开启!
查看>>
人工智能需要一个可被证明的理论作为基础 | 哈佛丘成桐
查看>>
入门 | 一文概览深度学习中的激活函数
查看>>
一分钟整明白Tensorflow Extended
查看>>
人工智能再次参加高考:和作家比写作文,AI能打多少分?
查看>>
云创冬日紫金山踏雪游记
查看>>
西安思源学院电子信息工程学院院长张卫钢一行到访
查看>>
邀请函|欢迎参加2019云创大数据实验平台金融类/电子商务类/数学统计类院校各省总代理招募大会!...
查看>>
云创大数据的2018年!
查看>>
QNX简介
查看>>
MQTT协议基本介绍
查看>>
进程和线程是操作系统基本概念,了解一下
查看>>
SSL与TLS的区别以及介绍
查看>>
对象切割 - 常量引用传递
查看>>
北邮同学面经
查看>>
Effective C++条款16:成对使用new和delete时要采取相同形式
查看>>