No command prompt avaliable

This is a discussion on No command prompt avaliable within the A Brief History of Cprogramming.com forums, part of the Community Boards category; we've this new computer at school( 'Dell' running Win2k Pro), but they don't happen to have the Ms-DOs command prompt ...

  1. #1
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70

    No command prompt avaliable

    we've this new computer at school( 'Dell' running Win2k Pro), but they don't happen to have the Ms-DOs command prompt avaliable in the student account, so ( i thought it would be fun to hack a simple program called 'console' to sub. it), have this source code:

    #include <stdio.h>
    #include <stdlib.h>
    #define console\ ___________________Console_____________________

    int main(int argc, char *argv[]){
    char *command[];
    int count = 1;
    printf("Console\n")
    while((count) || (strcmp(command,"exit"))!= 0){
    count--;
    printf("?> ");
    scanf("%s", command);
    system(command);
    }
    system("cls");
    return 0;
    }

    only the network commands happen to work, none does 'dir' or 'cd' . what in the hell is wrong with the program.

    thx in advance!
    Ünicode¬>world = 10.0£

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,755
    > char *command[];
    This is a meaningless declaration
    char command[80];

    > scanf("%s", command);
    This only reads the first word

    In the spirit of the program, try
    gets( command );

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL_FillRect problem
    By Frost Drake in forum Game Programming
    Replies: 4
    Last Post: 09-16-2006, 10:32 PM
  2. what functions are avaliable in kernel32.dll?
    By Fishskin in forum Windows Programming
    Replies: 3
    Last Post: 09-17-2005, 02:30 PM
  3. anyone avaliable
    By xlord in forum C Programming
    Replies: 2
    Last Post: 10-20-2002, 04:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21