Answer» I know, i know....USING the system function in C...but it just doesnt work 4 me... Maybe someone can tell me what i'm doing wrong..
My c-program and my batch file are in the same folder...the name of my batch file is "openrob"...and if i run it from command prompt, it works..this is the simple code i wrote:
#INCLUDE #include
void main() { clrscr(); printf("will call the batch file\n"); system("openrob"); getch(); }
I TRIED it putting the batch file in a separate drive altogther and specifying the path instead....still doesnt work...and yeah..my batch file doesnt take any arguments...
i also followed the same procedure...created a new batch file and TYPED out the same c-file as given in this link...
http://www.gidforums.com/t-5099.html
that didnt work either...is there a problem with my system or am i doing something fundamentally wrong??
Any suggestions...Ah, the famous "doesn't work" problem...
what error messages do you get? Well...thats the thing...no error msg...!!!!!!
it executes all statements before the call..n all the statements after the call...and when i trace it out...it shows that it's EXECUTING the system() statement too...but nothing happens!!
There's no problem with the batch file though...coz i've checked it a hundred times from all possible locations and it works!Code: [Select]system("openrob");
try"
Code: [Select]system("openrob.bat"); what are you actually doing in your batch file. if its possible, do everything with C. Is it a constrain that you must use C ? because if you are doing system administrative work, C is not the "appropriate" tool for the job. I am having the same problem using Java with the same results.openrob.bat also doesnt work...
it's a system quirk i guess...coz the same thing is working in one of my frnz system..!!!!
|