Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
C++

I would like to know how to create a program that will allow me to create clickable buttons to run certain dos commands in a GUI interface that will be friendly to windows 7 users.

Such as

(Lost access to mapped drives?)<-- Button.

Command line in dos for the above button = C:\gpupdate /Force

open a windows run then close.
Posted
Comments
Sergey Alexandrovich Kryukov 17-Jan-13 22:16pm    
Huh?
—SA

In windows NT/XP/Vista/7/8 this is now called the "command window", activated by calling "cmd.exe" with various parameters (/K and /C are likely important to you). You can also activate this with several APIs within a program (which is what I assume you want since you flagged your question with "C++"):

- WinExec() // (don't use this any more)
- CreateProcess()
- system()
- ShellExecute()/ShellExecuteEx()
- [others]

I'd suggest you ask Google about CreateProcess().
 
Share this answer
 
There is no such thing as DOS, more than a decade. Talking about "DOS commands" for Windows 7 is just ridiculous: there was no such thing in… several past Windows versions. The question makes no sense at all.

—SA
 
Share this answer
 
Comments
Abhinav S 17-Jan-13 23:24pm    
5. But I think he meant opening a dos prompt. :)
Sergey Alexandrovich Kryukov 18-Jan-13 1:02am    
Thank you, Abhinav.
But... can you keep a secret? :-) The concept of "DOS prompt" also gone, it's not there... several latest versions of Windows. There is nothing similar. And OP did not mean it. OP actually think about starting the application (bad idea, anyway). It has nothing to do with any "prompt", anything like "CMD.EXE" (which, it turn, has nothing do to with starting application; this is the usual mistake of the beginners to execute CMD.EXE to start some other application; works but makes no sense at all); and nothing to do with non-existing "DOS prompt".
—SA
 
Share this answer
 

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