问题描述
我想设计一个小软件,用VC++6.0的,通过点击按纽,能自动执行以下批处理文件eChooff@echoWindowsRegistryEditorVersion5.00>>ABC.reg@echo[-HKEY_LOCAL_MACHINESOFTWAREKasperskyLabLicStorage]>>ABC.reg@echo[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftCryptographyRNG]>>ABC.reg@echo[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftSystemCertificatesSPCCertificates]>>ABC.reg@regedit/sABC.REGdelABC.REG请问如何设计,说的详细些,小弟是个菜鸟!(比如哪里加入头文件,建立类向导等等)
解决方案
解决方案二:
CreateProcess
解决方案三:
system也可以createprocess的例子STARTUPINFOsi;PROCESS_INFORMATIONpi;ZeroMemory(&si,sizeof(si));si.cb=sizeof(si);si.dwFlags|=STARTF_USESHOWWINDOW;si.wShowWindow=SW_SHOW;ZeroMemory(&pi,sizeof(pi));charfile[300]="Explorer.exe";strcat(file,dir);if(!CreateProcess(NULL,//Nomodulename(usecommandline).file,//Commandline.NULL,//Processhandlenotinheritable.NULL,//Threadhandlenotinheritable.FALSE,//SethandleinheritancetoFALSE.0,//Nocreationflags.NULL,//Useparent'senvironmentblock.NULL,//Useparent'sstartingdirectory.&si,//PointertoSTARTUPINFOstructure.&pi)//PointertoPROCESS_INFORMATIONstructure.){AfxMessageBox("CreateProcessfailed.");}
解决方案四:
我还是搞不明白,能把具体代码写出来吗?
解决方案五:
voidCTest2Dlg::OnButton1(){//TODO:AddyourcontrolnotificationhandlercodehereSTARTUPINFOsi;PROCESS_INFORMATIONpi;ZeroMemory(&si,sizeof(si));si.cb=sizeof(si);si.dwFlags|=STARTF_USESHOWWINDOW;si.wShowWindow=SW_SHOW;ZeroMemory(&pi,sizeof(pi));if(!CreateProcess(NULL,//Nomodulename(usecommandline)."d:\a.bat",//Commandline.NULL,//Processhandlenotinheritable.NULL,//Threadhandlenotinheritable.FALSE,//SethandleinheritancetoFALSE.0,//Nocreationflags.NULL,//Useparent'senvironmentblock.NULL,//Useparent'sstartingdirectory.&si,//PointertoSTARTUPINFOstructure.&pi)//PointertoPROCESS_INFORMATIONstructure.){AfxMessageBox("CreateProcessfailed.");}}
解决方案六:
这个批处理我想直接添加在程序里,不通过调用D盘里的,怎么设计?
解决方案七:
我也想知道,正在找這方面的資料~~~~~
解决方案八:
有问题请先GOOGLE,BAIDU