-1

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
  • 30,396
  • 15
  • 136
  • 260

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