0

I'm unable to open a folder in cmd. The folder name has a space

The script that I'm working on is

start D:\My Data

which does not work. However start D:\MyData seems to work

but I need the space in the folder name...

start "D:\My Data" just opens another cmd window:

cmd

phuclv
  • 26,555
  • 15
  • 113
  • 235
Ananth RK
  • 1
  • 1
  • 2

1 Answers1

0

You need to surround the string with quotes otherwise the interpreter takes it as 2 separate strings

start "D:\My Data"

the compiler sees 2 strings: start, and D:\My Data
from start D:\My Data the compiler sees 3: start, D:\My and Data

Hazzdood
  • 173
  • 1
  • 2
  • 12
  • Thanks for the reply Hazzdod, i did try as suggested. the command just opened another command prompt window – Ananth RK Jun 04 '18 at 10:52
  • and i found a similar thread https://superuser.com/questions/511486/how-to-start-open-a-file-folder-that-contains-space-in-its-name-through-command?noredirect=1&lq=1 start "" "d:\my data" and start "" "d:\R & D" worked – Ananth RK Jun 04 '18 at 11:00