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

    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
    New Zealand
    Rep Power

    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 Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Changing current directory

    Not a Java question. Moved from New to Java.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Wrong current working directory
    By tux008 in forum Advanced Java
    Replies: 10
    Last Post: 07-12-2011, 09:22 AM
  2. changing current directory
    By flaca in forum New To Java
    Replies: 7
    Last Post: 03-06-2011, 03:50 AM
  3. How to get Current Directory through File
    By Java Tip in forum
    Replies: 0
    Last Post: 04-05-2008, 11: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, 05:24 PM
  5. How can i get current directory?
    By Ashley in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 02: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