Click here to Skip to main content
11,577,643 members (61,688 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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 17-Jan-13 16:02pm
Comments
Sergey Alexandrovich Kryukov at 17-Jan-13 22:16pm
   
Huh?
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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().
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
Abhinav S at 17-Jan-13 23:24pm
   
5. But I think he meant opening a dos prompt. :)
Sergey Alexandrovich Kryukov at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

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

  Print Answers RSS
0 Peter Leow 180
1 DamithSL 170
2 Richard MacCutchan 125
3 OriginalGriff 115
4 Abhinav S 100
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 681
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 375


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100