0

I have an sd card and I want to navigate cmd to it. But when I type: cd D:\MyFolder then this is the output:

C:\WINDOWS\system32>cd D:\MyFolder

C:\WINDOWS\system32>

he does not say that the path does not exist but also does not navigate to it. What is my problem? can I solve it?

Edit:

I have windows 10 newest version

Matthijs990
  • 637
  • 3
  • 26
  • Does this answer your question? [why is my cd %myVar% being ignored?](https://stackoverflow.com/questions/33484008/why-is-my-cd-myvar-being-ignored) – Raymond Chen Nov 06 '19 at 14:24
  • No it did not answer my question – Matthijs990 Nov 07 '19 at 08:35
  • [This answer](https://stackoverflow.com/a/33484400/902497) says "Command CD changes by default the current directory on current drive only. Option /D to change current directory to a directory on any drive with a letter should be always used when current directory on starting a batch file is not fixed on same drive as temporarily used current directory." – Raymond Chen Nov 07 '19 at 18:52
  • and this was first – Matthijs990 Nov 10 '19 at 10:23

1 Answers1

1

Try to use:

C:\WINDOWS\system32>cd /d D:\

D:\

because cd is the shortcut of cange dictory and not change drive and /d tells him to switch drive

and if you add this:

@cd /d %1

to a file called sd.bat (switch drive) what is placed in the folder C:\windows\system32 then you can just do:

C:\WINDOWS\system32>sd ..\

C:\WINDOWS>sd D:\

D:>sd my-folder

D:\my-folder>

etc.

Matthijs990
  • 637
  • 3
  • 26