command prompt has wrong current directory?

  • Thread starter Thread starter Oliver Rasto
  • Start date Start date
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.
 
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.
 
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" ?
 
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
 
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
 
Back
Top