Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

I want to run mkdir command through shell execute. If i run
cmd.exe /c mkdir -p "C:\TestFolder"
it is creating testFolder in C drive. Same i want to do through Sell execute.

But below code is not working
C++
ShellExecute(NULL, _T("cmd.exe /c mkdir -p \"C:\\TestFolder\""), NULL, NULL, NULL, SW_SHOWNORMAL);
ShellExecute(NULL, _T("/c mkdir -p \"C:\\TestFolder\""), _T("cmd.exe"), NULL, NULL, SW_SHOWNORMAL);

Can any body tell what is the wrong with the above code?

Thank you all.
Posted
Updated 11-Jan-12 0:03am
v3

1 solution

C++
ShellExecute(NULL, NULL, _T("cmd.exe"), _T("/c mkdir -p \"C:\\TestFolder\""), NULL, SW_SHOWNORMAL);
 
Share this answer
 
v2
Comments
Member 10252012 16-Oct-13 9:19am    
I want to sent a mail by using shellExecute.
iam using this code:
CString str1("open"),str2("mailto:pradeepkumarv@amiindia.co.in ? subject=Hi & cc=palinabheemar@amiindia.co.in");
ShellExecute(NULL, str1, str2, NULL , NULL, SW_SHOWDEFAULT);
after running this code it was opened the outlook.But I need to send the mail automatically.So tell me what changes it requires.
Email me:bheemapalina@gmail.com

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900