Results 1 to 3 of 3
  1. #1
    Lemon Squeeze is offline Member
    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Default Changing current directory

    Hello everyone,
    When I want to compile my source file and I want to change my directory to where the file is located, instead of being able to write

    cd C:\java

    I have to write cd C:\Users\pcworld\Document\Java

    Everything works fine but I just wondered if I could do anything to enable me to just write cd C:\java instead?

    Many Thanks

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,547
    Rep Power
    11

    Default Re: Changing current directory

    "C:\Users\pcworld\Document\Java" and "C:\java" are two different places. So you can't cd to one if you mean the other.

    The cd command uses relative paths - paths relative to where you currently are. So, for example, if you are in the C:\Users\pcworld\Document directory (folder), you can say

    Java Code:
    c:\Users\pcworld\Document>cd Java
    This will also take you to C:\Users\pcworld\Document\Java.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,937
    Rep Power
    16

    Default Re: Changing current directory

    Not a Java question. Moved from New to Java.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Wrong current working directory
    By tux008 in forum Advanced Java
    Replies: 10
    Last Post: 07-12-2011, 08:22 AM
  2. changing current directory
    By flaca in forum New To Java
    Replies: 7
    Last Post: 03-06-2011, 02:50 AM
  3. How to get Current Directory through File
    By Java Tip in forum java.io
    Replies: 0
    Last Post: 04-05-2008, 10:14 AM
  4. How to get the current working directory in EJB?
    By sathish_2111 in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 07-19-2007, 04:24 PM
  5. How can i get current directory?
    By Ashley in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •