Thread: Help using the cmd prompt (Vista)

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    7

    Help using the cmd prompt (Vista)

    Hello, I need help using the command prompt to run my program and obtain the output. My program is supposed to echo the input one word per line, via getchar and putchar functions.

    The format of the cmd prompt line is supposed to be something like "C:\CS539>lab2a.exe<lab2ain.txt>lab2aout.txt" where lab2ain.txt is the input file, and lab2aout.txt is the output file that gets created.

    However, when I run the command prompt on vista I get"C:\Users\Matthew>" and I do not know how to alter it to the correct format.

    My program is under C: -> Users -> Matthew -> Visual Studio 2008 -> Projects -> lab2a -> Debug -> lab2a.exe

    Any help would be highly appreciated, thanks in advance. I just simply want to know the correct command prompt usage to run my program.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The command "cd" changes the current directory. So you've got the Users and Matthew for free, you have to do the rest of it:
    Code:
    cd "Visual Studio 2008\Projects\lab2a\Debug"
    You can run it there, or if you need to move the file, well, there's a command called move.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I'd suggest learning how to use the command prompt a little more if you're going to be writing software.
    windows command line tutorial - Google Search
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by cpjust View Post
    I'd suggest learning how to use the command prompt a little more if you're going to be writing software.
    windows command line tutorial - Google Search
    Oh now you've done it.... (puts on anti-Elysia guards)

    But yes, generally you do need to know how to operate a computer if you want to make it do things (and no, clicking does not qualify).

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    7
    Quote Originally Posted by tabstop View Post
    The command "cd" changes the current directory. So you've got the Users and Matthew for free, you have to do the rest of it:
    Code:
    cd "Visual Studio 2008\Projects\lab2a\Debug"
    You can run it there, or if you need to move the file, well, there's a command called move.
    Thank you very much, that is everything I needed. And yes, I am a complete newbie with the command prompt, and this is the first time I've tried running my program by using it. Thank you again.

  6. #6
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by tabstop View Post
    Oh now you've done it.... (puts on anti-Elysia guards)
    LOL! Well I didn't say using the Command Prompt is all you need to know. (puts on anti-MK27 guards)
    Last edited by cpjust; 09-26-2009 at 09:30 PM.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. corruption, decay, Vista Gateway laptop
    By CodeMonkey in forum Tech Board
    Replies: 5
    Last Post: 06-13-2009, 01:50 PM
  2. Damn ATI!
    By AloneInTheDark in forum Tech Board
    Replies: 48
    Last Post: 02-16-2008, 09:34 PM
  3. First Vista virus
    By mrafcho001 in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-11-2005, 10:39 PM
  4. Removing spaces from a "string"
    By sytaylor in forum C++ Programming
    Replies: 20
    Last Post: 03-25-2004, 10:14 AM
  5. Password prompt in unix w/o \b
    By rafe in forum C++ Programming
    Replies: 1
    Last Post: 10-09-2002, 08:54 AM