BeannaeB
BeannaeB

Reputation: 21

"The directory name is invalid." does anybody have any ideas on how to go about fixing this command prompt error?

Hi can anyone help me out ?

I have just gotten a new laptop for developing and i have come to a halt already(7 mins).

When accessing files via the command prompt i keep getting this error "The directory name is invalid."

My file is saved on the desktop , i can navigate there well and good its just i cant enter into my eggs file or any file on my desktop via the command prompt. The path is correct.

C:\Users\toshiba\Desktop> cd ChromeSetup.exe

The directory name is invalid.

I have messed around with the command prompt settings and that but to no avail :/. If someone could help me out id be so grateful as i have to start an important project and have been stuck on this for a while now. Thanks in advance.

Upvotes: 0

Views: 18567

Answers (1)

Randy
Randy

Reputation: 9819

You can CD to folders, not to files.

This is because CD is short for:

Change Directory

cd ..\..\toshiba\Desktop should work, because you CD in your folders

running cd ChromeSetup.exe is never going to work, unless ChromeSetup.exe is some weird folder name.


If you want to execute that executable without closing the CMD prompt, run this command:

cmd /K "ChromeSetup.exe"

If you want to open a file with a chosen program, use the executable command and give the filename as parameter:

"C:\Program Files\Adobe\Photoshop\photoshop" "C:\Users\user\Documents\document.pdf"

Upvotes: 4

Related Questions