Cannot change directory with cd in DOS using Win7

0

I would like to change my Present Working Directory in DOS (I am running Win7 professionnal). When I perform a cd D:\, nothing happens:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\>cd D:\
D:\

C:\>

If I do the same using PowerShell, it works:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\> cd D:\
PS D:\>

Any ideas about what is going wrong with DOS?

jlandercy

Posted 2014-11-13T14:37:19.177

Reputation: 125

Answers

2

I believe that the command:

cd d:\

in a command prompt (dos) will result in the current directory for the d: drive being changed to \ It does not change the current drive.

So, if you do:

c: \> cd d:\somedir
c: \>
c: \> d:
d: \somedir>

Timbo

Posted 2014-11-13T14:37:19.177

Reputation: 390

+1 worked. Amazing, this is a huge inconsistency. – jlandercy – 2014-11-13T15:01:29.050

Not really. CD is not a native command in powershell. It is an alias to Set-Location which while similar to CMD's CD is not an exact replica and was never intended to be an exact replica. – EBGreen – 2014-11-13T15:39:41.773

It's not a bug, it's a feature.... – Timbo – 2014-11-13T22:22:25.353

2

Yeah, standard CD on a command prompt does not change the drive. try the /D parameter:

cd /d D:\

Help on the CD command:

help cd

Berend

Posted 2014-11-13T14:37:19.177

Reputation: 1 824

+1 Worked too. Seems I have been fooled by my unix-behaviour. – jlandercy – 2014-11-13T15:02:41.223

0

Don't use the "cd" when switching drive letters.

Rob

Posted 2014-11-13T14:37:19.177

Reputation: 444