Click here to Skip to main content
15,880,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: VC++/MFC Pin
Richard MacCutchan12-Jul-22 21:42
mveRichard MacCutchan12-Jul-22 21:42 
GeneralRe: VC++/MFC Pin
Victor Nijegorodov13-Jul-22 0:22
Victor Nijegorodov13-Jul-22 0:22 
AnswerRe: VC++/MFC Pin
Gerry Schmitz11-Jul-22 12:21
mveGerry Schmitz11-Jul-22 12:21 
AnswerRe: VC++/MFC Pin
Richard MacCutchan11-Jul-22 21:33
mveRichard MacCutchan11-Jul-22 21:33 
QuestionMessage Closed Pin
8-Jul-22 6:24
Member 149687718-Jul-22 6:24 
GeneralRe: how to start QProcess not coding argument parameter ? Pin
Richard MacCutchan8-Jul-22 7:53
mveRichard MacCutchan8-Jul-22 7:53 
AnswerRe: how to start QProcess not coding argument parameter ? Pin
jeron18-Jul-22 10:21
jeron18-Jul-22 10:21 
Question[Solved] Sending input to system("command") prompt Windows Pin
JohnCodding6-Jul-22 22:51
JohnCodding6-Jul-22 22:51 
In my program I'm using system("") command to add a variable into User variables using reg add. In the future I'll want to update the variable value to something else, but if the variable exists it will prompt the user to input Y/N to override it. Is there a way to automatically give the input instead of the user? I was thinking that maybe I could use system("y"), but it still waits for the input from the user, and then gives the error that y is not a command.
I can't use Windows.h to modify registry, so I want to find a solution to this. Maybe I'll need system("") for something else in the future that will have the same problem with having to input something.

Solution:
Victor Nijegorodov wrote:
According to the reg add | Microsoft Docs you can add option /f that will cause the adding the registry entry without prompting for confirmation.


modified 7-Jul-22 7:00am.

GeneralRe: Sending input to system("command") prompt Windows Pin
Richard MacCutchan7-Jul-22 0:06
mveRichard MacCutchan7-Jul-22 0:06 
GeneralRe: Sending input to system("command") prompt Windows Pin
Greg Utas7-Jul-22 0:14
professionalGreg Utas7-Jul-22 0:14 
GeneralRe: Sending input to system("command") prompt Windows Pin
Richard MacCutchan7-Jul-22 1:25
mveRichard MacCutchan7-Jul-22 1:25 
GeneralRe: Sending input to system("command") prompt Windows Pin
JohnCodding7-Jul-22 0:15
JohnCodding7-Jul-22 0:15 
GeneralRe: Sending input to system("command") prompt Windows Pin
JohnCodding7-Jul-22 0:20
JohnCodding7-Jul-22 0:20 
GeneralRe: Sending input to system("command") prompt Windows Pin
Victor Nijegorodov7-Jul-22 0:29
Victor Nijegorodov7-Jul-22 0:29 
GeneralRe: Sending input to system("command") prompt Windows Pin
JohnCodding7-Jul-22 0:54
JohnCodding7-Jul-22 0:54 
QuestionRe: [Solved] Sending input to system("command") prompt Windows Pin
David Crow7-Jul-22 2:11
David Crow7-Jul-22 2:11 
QuestionConvert function to read from string instead of file in C Pin
sahil Ranka6-Jul-22 0:19
sahil Ranka6-Jul-22 0:19 
AnswerRe: Convert function to read from string instead of file in C Pin
Mircea Neacsu6-Jul-22 0:49
Mircea Neacsu6-Jul-22 0:49 
AnswerRe: Convert function to read from string instead of file in C Pin
Richard MacCutchan6-Jul-22 1:19
mveRichard MacCutchan6-Jul-22 1:19 
QuestionRe: Convert function to read from string instead of file in C Pin
David Crow6-Jul-22 4:38
David Crow6-Jul-22 4:38 
QuestionConvert curl request Pin
_Flaviu4-Jul-22 3:14
_Flaviu4-Jul-22 3:14 
AnswerRe: Convert curl request Pin
k50544-Jul-22 4:39
mvek50544-Jul-22 4:39 
GeneralRe: Convert curl request Pin
_Flaviu4-Jul-22 4:52
_Flaviu4-Jul-22 4:52 
GeneralRe: Convert curl request Pin
k50544-Jul-22 5:25
mvek50544-Jul-22 5:25 
GeneralRe: Convert curl request Pin
_Flaviu4-Jul-22 5:43
_Flaviu4-Jul-22 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.