Question: My cygwin used to work properly before, but suddenly it starts to complain: "file does not exist" under /cygdrive/d ...

The problem looks like this: if I **cd** to that folder I can saw that file and **cat/ls afile** without any problem, but if I use something like **ls /cygdrive/d/afile** it will complain "file does not exist".

So I traced backwards on the file system, and found there's some issue with the virtual path /cygdrive

```
/cygdrive 
cd /cygdrive/
Error: Current working directory is a virtual Cygwin directory which
does not exist for a native Windows application. Can't start native
Windows application from here.

```

Seems this /cygdrive is broken, does anyone know how to fix it?

Adding more detail:

```
$grep cygdrive /etc/fstab
# none /cygdrive cygdrive binary,posix=0,user 0 0

$type -a cd
#cd is a shell builtin

```

Answer: 
I get that error message if I do a `cd /cygdrive` and then try to execute a (non-Cygwin) Windows command. I don't get it if I just `cd /cygdrive`.

The only explanation I can think of is that you've assigned a value to the bash special variable `$PROMPT_COMMAND`.

Quoting the bash documentation:

> 
> 'PROMPT\_COMMAND'  
> 
>  If set, the value is interpreted as a command to execute before
>  the printing of each primary prompt ('$PS1').
> 
> 
> 

For example:

```
$ PROMPT_COMMAND=cmd.exe ; cd /cygdrive
Error: Current working directory is a virtual Cygwin directory which does
not exist for a native Windows application.
Can't start native Windows application from here.

-bash: /cygdrive/c/Windows/system32/cmd.exe: Not a directory

```
move to the right directory by replacing (if you are in C drive for example)

```
 cd /cygdrive

```

by

```
cd c:/cygdrive

```

also suitable:

```
cd /c/<rest of your path>

```