| | |
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 |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h







