| | |
Hw to execute dos commands in C
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
I need to execute some dos commands like executables(.exe)
PLEASE HELP ME OUT OF THIS
Through system command you can call all commands you can call in a command prompt mode and also execute certain kinds of files too.
I Surf in "C"....
Take a look at ShellExecute
Edit: I misunderstood ArkM's post, I thought it was advising against the use of system() (as is usually the case). I suppose in this case, it would be okay?
Edit: I misunderstood ArkM's post, I thought it was advising against the use of system() (as is usually the case). I suppose in this case, it would be okay?
Last edited by death_oclock; Feb 26th, 2009 at 5:53 pm.
>Well I couldn't really make out if you people were against
>usage of system library function here in this context.
By my reading, death_oclock isn't sure, and ArkM hasn't stated a preference.
>If yes could you state the reason...?
In this case, system is still risky, but no more risky than ShellExecute as they both have the same vulnerability: unless you're careful about the path you pass, a malicious program can be run in place of the one you expected.
>usage of system library function here in this context.
By my reading, death_oclock isn't sure, and ArkM hasn't stated a preference.
>If yes could you state the reason...?
In this case, system is still risky, but no more risky than ShellExecute as they both have the same vulnerability: unless you're careful about the path you pass, a malicious program can be run in place of the one you expected.
I'm here to prove you wrong.
•
•
•
•
>Well I couldn't really make out if you people were against
>usage of system library function here in this context.
By my reading, death_oclock isn't sure, and ArkM hasn't stated a preference.
>If yes could you state the reason...?
In this case, system is still risky, but no more risky than ShellExecute as they both have the same vulnerability: unless you're careful about the path you pass, a malicious program can be run in place of the one you expected.
So once we are sure that the path given by user is right the system(<path>) should not create any problem.Isn't it Naure?
I Surf in "C"....
>Path is still a user input right ?
I don't know, the OP changed his post so that it no longer specifies.
>So once we are sure that the path given by user is right
>the system(<path>) should not create any problem.
It can still create problems, but those problems aren't something you can easily control with code.
I don't know, the OP changed his post so that it no longer specifies.
>So once we are sure that the path given by user is right
>the system(<path>) should not create any problem.
It can still create problems, but those problems aren't something you can easily control with code.
I'm here to prove you wrong.
![]() |
Similar Threads
- Executing dos commands in Java (Java)
- Save real Pinball. Please. (Game Development)
- How To Call Shell Script In Java (Java)
- How to boot a Windowsmachine over Network using TFTP? (Windows NT / 2000 / XP)
- com vs. exe (Assembly)
- shutdown pc from dos prompt (Windows tips 'n' tweaks)
- Question about DOS Batch Files (Legacy and Other Languages)
- can I invoke dos commands thru Java? (Java)
- Internet Explorer Bug lets you run DOS commands remotely (Web Browsers)
Other Threads in the C Forum
- Previous Thread: Array to an output file
- Next Thread: Ethernet forwarding in Linux using C
| Thread Tools | Search this Thread |
#include * append array arrays asterisks binarysearch calculate changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fflush fgets file fork forloop framework function getlasterror givemetehcodez grade gtkwinlinux hacking hardware histogram inches include incrementoperators input intmain() iso kernel keyboard km license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft motherboard mqqueue number oddnumber odf opendocumentformat opensource overwrite owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket socketprograming standard string structures systemcall testing threads turboc unix user variable voidmain() wab whythiscodecausesegmentationfault windowsapi







