FG
💻 Software

Using backslash to escape characters in cmd.exe (runas command as example)

Fresh5 days ago
Mar 15, 202671608 views
Confidence Score0%
0%

Problem

I see that the caret is the documented escape character. But, I have an example showing that for the double quote character, doesn't work and you have to use Why is that, and where is it documented?

Error Output

C:\>runas /user:Administrator "cmd /k dir \"%userprofile%\""

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Using backslash to escape characters in cmd.exe (runas command as example)

Low Risk

In cmd, does not escape . Here's a quick proof and explanation: Run . ( is a special char in cmd, means run then run .) We can see that both and are run successfully. Next, run . We can see that the output is . This is because the opening has not be…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment