Jump to content

Command Prompt - cd - 'invalid directory'


Azz
 Share

Recommended Posts

Hi guys,

I'm a relatively new programmer and have always used the linux OS for anything Java related.

I've recently started to use Windows for any proramming, but I have a pretty simple problem that I can't seem to solve.

If I need to enter an arguement via the command prompt for a java application to run, I try to use the CD command to get to the correct folder, etc.

The folder is called "NetBeansProjects" and is on my desktop. When I try to access this through my command prompt with the command 'cd NetBeansProjects' I get the response, 'invalid directory'

I'm at a bit of a loss on how to handle this because I simply can't access this folder via the command prompt.

Any advice would be appreciated.

Cheers,

Aaron.

Link to comment
Share on other sites

Hi Azz,

What directory are you in when trying to change to this directory? By default you are usually in your "c:\documents and settings\yourname" directory. If the folder is on your desktop you will need to do the following:

"cd desktop" - press enter (without quotes)

"cd netbeansprojects" - press enter (without quotes).

This should get you to that directory.

Link to comment
Share on other sites

Hi Azz,

What directory are you in when trying to change to this directory? By default you are usually in your "c:\documents and settings\yourname" directory. If the folder is on your desktop you will need to do the following:

"cd desktop" - press enter (without quotes)

"cd netbeansprojects" - press enter (without quotes).

This should get you to that directory.

Hey,

I probably should have specified that, but I make sure I am already in the desktop folder, as it were, when trying to access that folder.

if I type "dir", and in the list of files and fodlers, it shows the "NetBeansProjects" folder, which is why i really can't understand why it isn't working.

thanks.

Link to comment
Share on other sites

Can you provide a screenshot of your desktop where the folder is and a shot of the error you're getting?

might take me a minute or two, will have to try and work out how to put images up on here etc...

2 secs

Also, I have my icons on desktop hidden (that won't have anything to do with the problem, surely?), so will just screenshot the actual "desktop" folder, as it were, and the command prompt.

...

Link to comment
Share on other sites

Yes that worked. I don't have a lot of experience with Vista but try:

cd users - enter

cd aaron - enter

cd desktop - enter

dude, the image shows that I'm already in the Desktop folder.

My problem is getting into the "NetBeansProjects" folder through the command prompt. !? As BOTH images show that it IS in the Desktop folder. Therefore, I can't understand why I can't access it through the command prompt.

*sigh*

Link to comment
Share on other sites

  • 3 months later...

wow.. and i don't mean world of warcraft.. the answers here are totally useless..

i had exactly the same problem, and here is the answer:

the directory names are trunkated to 8 characters. so use,

cd NetBea~1

note that it adds up to 8 characters total including the 1st 6 characters of the directory name, ~, and 1 for the first directory that has these first 6 characters..

if there are more than 1 directory that has the same first letters, then i believe the numbers change in sequence... i dont know what happens once you have more than 9 directories with the same first 6 characters.. i dont remember experiencing anything like this in XP. may be i'm missing some properties that can be tuned. anybody has any further suggestions about the vista command prompt?

.. The folder is called "NetBeansProjects" and is on my desktop. When I try to access this through my command prompt with the command 'cd NetBeansProjects' I get the response, 'invalid directory'

I'm at a bit of a loss on how to handle this because I simply can't access this folder via the command prompt..

Link to comment
Share on other sites

Nothing happens if you use more than 9 letters. The 8 characters thing is just to shorted command lines down.

You need to put the exact directory of the folder in after cd.

So for the explanation's sake. Say the folder is on your desktop...

 cd C:\Documents and Settings\indie prime\Desktop\NetBeansProjects

If it doesn't work, check to see if the folder is actually in the directory you think it is. Even if it shows on Windows Explorer.

dir C:\Documents and Settings\Indie Prime\Desktop

It should come up in the list there somewhere.

I've used CMD for a long time now for Java related programming and often had a similar problem.

wow.. and i don't mean world of warcraft.. the answers here are totally useless..

I don't think so actually. I quite like this forum. :D Even for non-IT-related issues. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy