parsing result from command line arguments in c++
-
my requirement is that i have to set static ip address in command line and the netsh command i have to call from my c++ program.van any body suggest how to accomplish this?
-
its not goin to help.if anybody can provide some sample code,then that would be helpfull.My requirement is that what ever i get at commandline,i should be able to get it back in my code
-
its not goin to help.if anybody can provide some sample code,then that would be helpfull.My requirement is that what ever i get at commandline,i should be able to get it back in my code
an89 wrote:
its not goin to help
and why isn't it going to help? Any wise guesses :rolleyes: You asked about reading the command line arguments and parsing them. The logic does the same :doh:
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
an89 wrote:
its not goin to help
and why isn't it going to help? Any wise guesses :rolleyes: You asked about reading the command line arguments and parsing them. The logic does the same :doh:
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
see,in the tutorial that u mentioned we have to give arguments at commandline,right?and in the program we are extracting those arguments. But in my application,through my code i'll give a command,and i need the output of the command when the command executes successfully.I hope I made myself clearer this time.
-
my requirement is that i have to set static ip address in command line and the netsh command i have to call from my c++ program.van any body suggest how to accomplish this?
- Parse the commandline and get ip address as suggested by
_AnShUmAn_
. 2) For setting static ip by usingnetsh
command, Please refer this link - http://support.microsoft.com/kb/257748[^] 3) For executingnetsh
command from your C++ code, useShellExecute()
api. Check its documentation here - http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx[^] Regards, Jijo.
_____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
- Parse the commandline and get ip address as suggested by
-
see,in the tutorial that u mentioned we have to give arguments at commandline,right?and in the program we are extracting those arguments. But in my application,through my code i'll give a command,and i need the output of the command when the command executes successfully.I hope I made myself clearer this time.
humf. :^) You can use the argument to pass as a parameter to ShellExecute or CreateProcess. how do you give the command and to whom...
an89 wrote:
I hope I made myself clearer this time.
Not for me, it's still a blurr picture
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
my requirement is that i have to set static ip address in command line and the netsh command i have to call from my c++ program.van any body suggest how to accomplish this?
an89 wrote:
suggest how to accomplish this?
By searching for
argc
andargv
."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch