Categories
Ξ TREND

How to escape spaces in file paths on the Windows command line

Command line environments like the Windows command prompt and PowerShell use spaces to separate commands and arguments, but file and folder names can also contain spaces. To specify a file path with a space in it, you must “escape”.

Command line 101: Why you have to escape spaces

“Escape” from a character changes its meaning. For example, escaping a space will cause the shell to treat it as a standard space character instead of a special character that separates command line arguments.

For example, suppose you have a text file that you want to see the contents of. You can do this with the type command. Assuming the text file is at C:TestFile.txt, the following command at the command prompt will display its contents:

type C:TestFile.txt

Excellent. Now what if you have the same file in C:Test FolderTest File.txt? If you try to run the following command, it won’t work – those spaces in the file path are getting in the way.

type C: Test Folder Test File.txt

The command line thinks you are trying to find a file called C:Test and says “the specified path cannot be found”.

Three ways to escape spaces in Windows

There are three different ways to escape file paths in Windows:

Enclosing the path (or parts of it) in double quotes (”).
Adding a caret character (^) before each space. (This only works in command prompt/CMD, and doesn’t seem to work with all commands.)
Adding a backtick character (`) before each space. (This only works in PowerShell, but it always works.)

We will show you how to use each method.

Enclose the path in quotation marks («)

The standard way to ensure that Windows treats a file path correctly is to enclose it in double quotes (”). For example, with our sample command above, we would simply run the following:

type “C:Test FolderTest File.txt”

In fact, you can enclose parts of the path in quotes if you prefer. For example, let’s say you have a file called File.txt in that folder. You could run the following:

type C:”Test Folder”File.txt

However, that is not necessary; in most cases, you can use quotes around the entire path.

This solution works in both the traditional Command Prompt (CMD) environment and Windows PowerShell.

Sometimes: use the Caret character to escape spaces (^)

In the command prompt, the caret character (^) will allow you to escape spaces, in theory. Just add it before each space in the file name. (You’ll find this character in the number row on your keyboard. To type the caret, press Shift + 6.)

Here’s the problem: while this should work, and sometimes does, it doesn’t work all the time. The command prompt handling of this character is strange.

For example, with our sample command, you would run the following and it wouldn’t work:

type C:Test^ FolderTest^ File.txt

On the other hand, if we try to open our file directly by typing its path in the command prompt, we can see that the caret escapes spaces correctly:

C:Test^FolderTest^File.txt

So when does it work? Well, based on our research, it seems to work with some apps and not others. Your mileage may vary depending on the command you are using. The command prompt handling of this character is strange. Try it with whatever command you are using, if you are interested it may or may not work.

For consistency, we recommend that you stick to double quotes in the command prompt, or switch to PowerShell and use the backtick method below.

PowerShell: Use the backtick character (`)

PowerShell uses the backtick character (`) as an escape character. Just add it before each space in the file name. (You’ll find this character above the Tab key and below the Esc key on your keyboard.)

type C:Test` FolderTest` File.txt

Each backtick character tells PowerShell to escape the next character.

Note that this only works in the PowerShell environment. You’ll need to use the caret at the command prompt.

If you are familiar with UNIX-like operating systems such as Linux and macOS, you may be used to using the backslash () character before a space to escape. Windows uses this for normal file paths, so it doesn’t work – the accent (^) and backtick (`) characters are Windows’ version of the backslash, depending on the command line shell you’re using.

Categories
Ξ TREND

Disney Dreamlight Valley: Build and unlock paths


Anyone who has already unlocked some residents in the new Disney Dreamlight Valley and thus built their buildings in the valley will sooner or later ask themselves how the buildings can be connected via paths. How can you build paths and what do you have to do if you want to unlock more paths? In this guide we show how you can connect the houses with paving in the form of paths.

Building and creating paths

The paths in Disney Dreamlight Valley can be built like other “landscape gardening” in the form of trees, rocks or even fences via the “Furniture” menu.

  1. Open the inventory in the game and then switch from “Inventory” to “Furniture”.
  2. Scroll down the furniture menu and then select “Paths” under the “Landscape Gardening” section.
  3. You can now choose from the paths that have already been created at the workbench.

Make paths and paving at the workbench

The prerequisite for this, however, is that the paths in the form of paving have been created at the workbench beforehand. To create the paths you need a wide variety of materials such as earth, stones, hardwood, sand or clay.

  1. Find any workbench and interact with it.
  2. Switch to the “Fence and Paving” tab and select and create the ground or path.

These paths can currently be made in Disney Dreamlight Valley.

  • Natural stone path – 1x pebble, 1x sand
  • Asphalt – 1x sand, 1x pebbles, 1x coal ore
  • Sun-Dried Road – 1x Clay, 1x Soil
  • Cobblestone street – 2x stone
  • Muddy Path – 1x Earth, 1x Hardwood
  • Strewn gravel path – 1x earth, 1x pebbles
  • Leafy Path – 1x Hardwood, 1x Soil
  • Ominous Cobblestone Street – 1x Stone, 1x Earth
  • Snowy cobblestone street – 1x stone, 1x snowball
  • Gold and Opal Road – 1x stone, 1x gold bar
  • Golden Cobblestone Street – 1x Gold Bar
  • Gemstone and Opal Road – 1x stone, 1x tourmaline, 1x aquamarine, 1x alexandrite

Unlock more paths? There is currently no way to unlock additional paths. You cannot unlock other paths or paving either through main quests or from Scrooge McDuck in the shop. The available paths can be made at any time at the workbench as described above. However, further floors and paths will probably be added in future updates.