|
Sir, It works now Thank you for you kind,quick and constant help!
|
|
|
|
|
Sir, I have completed everything and when I run my code the command window disappears immediately what should I do now? Thank you
|
|
|
|
|
The system process will only run the command that you send it, and then terminate. There are alternative ways of doing this: see the exec commands at Process and Environment Control[^].
|
|
|
|
|
Sir, I referred here Execute a Program with C++[^]
and did this
ShellExecute(
NULL,
_T("open"),
_T("cmd.exe"),
_T("attrib"),
(show),
SW_SHOW);
it is showing the show (I mean the directory) like this K:\ but not ececuting the attrib.how could I solve this?
Thank you
|
|
|
|
|
If you are wanting to get the attributes of a file/folder, why do it the way we were doing it 30 years ago? See GetFileAttributes() instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Your parameters are not correct, and it will not work just by opening cmd.exe. You need to add the option to tell cmd to execute the sub-command in the parameter list automatically like:
PWSTR show = L"/k attrib D:\\";
ShellExecute(
NULL,
L"open",
L"cmd.exe",
show,
NULL,
SW_SHOW);
Of course, the attrib command will not operate on a drive letter, and as David mentions, there are better ways of getting this information.
|
|
|
|
|
Sir, Is there any other way to execute some commands like this to a specific drive by giving the drive string at the run time? because I have to define the drive name here?
I have referred to create process, shell execute etc.,
attributes is one of my functions I need to execute several different commands like this on a specific drive how could one do it?
Thank you
|
|
|
|
|
VISWESWARAN1998 wrote: ...I need to execute several different commands like this on a specific drive... Be specific.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Sir, my program will not do anything on its own.
I have a added GetLogicalDriveStrings in a combobox which will show the list of drive present in the PC. Then if the user wishes to add a directory by pressing a push button, then cmd function should execute and create a directory or hiding folders and so on on the drive specified.
I know it is much easier to do this manually but I am learning windows API so it will be helpful for my future use.
Thank you
|
|
|
|
|
VISWESWARAN1998 wrote: ...but I am learning windows API... Then start using it. Trying to do all of this via system() and ShellExecute() is all but completely wrong.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Sir, what to use? could you please explain me briefly?
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thank you sir I made it for now using ShellExecute function but I will try to do with the function (GetAttributes) suggested by you
|
|
|
|
|
I showed you how to do it in my correction of your code.
|
|
|
|
|
Thank you sir for your kind help. I made it to work finally with the help of your code
|
|
|
|
|
Hi,
I hace a win32 dll and I want to add dependency as static for my dll because I have a problem to install it on machine which desn't contains MFC dlls
MFC100U.DLL
MSVCR100.DLL
Any help please.
|
|
|
|
|
|
In the project properties, go to the option called "Use of MFC library" and choose static library.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
hi! ampersand don't underline my label when i debug, usemenomic is true

|
|
|
|
|
Is there a C / C++ / MFC question in here somewhere?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Can't assign an access key to a label ... because a label can't get focus.
|
|
|
|
|
It's a Windows Form (.NET) thing.
|
|
|
|
|
Fine ... It still looks like that's what he's trying to do.
Ampersand; underline; label; ...
|
|
|
|
|
|
He also used that reference (?)
|
|
|
|