command prompt has wrong current directory?

O

Oliver Rasto

Hi,

why is it, that when i type 'dir' in the current directory it alaways lists
the contents of the root directory?

i.e. when i type 'dir' in 'c:\winnt\' then it lists the contents of c:\
when i type 'dir' in 'i:\src\php\' then it lists the contents of i:\

When i have a file called 'file1' in directory 'c:\directory1' and i run
'type file1' in that directory then i get 'The system cannot find the
filespecified'. But when i copy the file 'file1' in the root directory 'c:\'
and i run the command 'type file1' in ANY direcotry on the drive it works
OK, even if the file 'file1' is not in the current direcotry.

What is wrong with my system?

Thank you.
 
F

foxidrive

Hi,

why is it, that when i type 'dir' in the current directory it alaways lists
the contents of the root directory?

i.e. when i type 'dir' in 'c:\winnt\' then it lists the contents of c:\
when i type 'dir' in 'i:\src\php\' then it lists the contents of i:\

When i have a file called 'file1' in directory 'c:\directory1' and i run
'type file1' in that directory then i get 'The system cannot find the
filespecified'. But when i copy the file 'file1' in the root directory 'c:\'
and i run the command 'type file1' in ANY direcotry on the drive it works
OK, even if the file 'file1' is not in the current direcotry.

What is wrong with my system?

Thank you.

The shortcut has the working directory as c:\

Type cmd
and then try your commands, after CDing to the correct folder.
 
M

Mark V

In said:
The shortcut has the working directory as c:\

Type cmd
and then try your commands, after CDing to the correct folder.

That does not seem to be the case as I read the OP, though I may be
wrong.

He claims the the CD *is* below the root and yet an unqualified DIR
lists root content. OP, please confirm this.

First seek out any DIR.CMD or DIR.BAT files on the system search
path, although since DIR is internal to CMD, this should not be the
problem.

Possible junk at a registry
...\command processor\
Autorun=
???

DIRCMD env var.? I would not think so, but worth a look.

DOSKEY macro for "dir" ?
 
T

ThorstenK

i think the issue is _how_ you run dir.

On a dos prompt in C:\temp
C:\temp>dir
HAS to show you the contents of C:\temp or there is something verry screwed
on your system.

if you run it in a .bat oder .cmd make sure your current directory is
C:\temp
cd /D C:\temp
dir
or dir C:\temp
to see where your current dir is run this at the beginning.
@echo on
cd
echo where am i?
pause
 
M

Mike Jones

ThorstenK said:
i think the issue is _how_ you run dir.

On a dos prompt in C:\temp
C:\temp>dir
HAS to show you the contents of C:\temp or there is something verry
screwed on your system.

if you run it in a .bat oder .cmd make sure your current directory is
C:\temp
cd /D C:\temp
dir
or dir C:\temp
to see where your current dir is run this at the beginning.
@echo on
cd
echo where am i?
pause

there's a DOSKEY synonym dir which runs "dir c:\" ?

try typing in (space)dir instead
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top