0

I need to be able to run a simple ROBOCOPY on a backup file that is location in: C:\Program Files (x86). I get an error when I try to test I get an error saying that it doesn't like the x86. I have also tried %programfiles% and that didn't resolve it either.

I appreciate any help!

7
  • 2
    Use "s around names with spaces.
    – DavidPostill
    May 17, 2016 at 17:11
  • Note that %programfiles% is (64-bit) C:\Program Files; if you want to use the variable (which you don't need to) for (32-bit) C:\Program Files (x86) it's %programfiles(x86)%. May 18, 2016 at 1:45
  • The quotes totally worked! Thanks! I really appreciate your help!
    – user595035
    May 19, 2016 at 14:44
  • You should really have included the line, then shown if it's really just a batch file issue(unlikely) or if it's also generally from the command line in which case nothing to do with batch files
    – barlop
    Dec 29, 2018 at 17:18
  • @barlop - this was 2.5 years ago. Dec 29, 2018 at 19:20

2 Answers 2

1

There are two way to do this.

  1. Use Double-quotes as stated by @DavidPostill
  2. Use the respective 8.3 name "PROGRA~2".

To determine the 8.3 name of the folder:

  • Open a command prompt
  • Type "dir /x" this will list the files and folder and their respective 8.3 notation
1
  • Thanks GeekyDaddy, I tried the 8.3 trick first, but I don't think the directory included the 8.3 name (as far as I could tell, but that might be user error as opposed to it not being there :))
    – user595035
    May 19, 2016 at 14:46
1

The use of single or double quotes referenced by @GeekyDaddy & mentioned initially by @DavidPostill - is whats required.

The 8.3 equivalent is as praise worthy.

Another tip to get exact / literal paths in (CMD) command-prompt is to start with a quoted string ("C:\P") such as:

"C:\P"

tab + tab + ... # & so-forth for each suggestion

This would give you suggestion which it ought to auto-complete for first / every match thereafter depending on the number of characters you'd typed. A belated version of bash-completion by 20+ years :-)

1
  • Great info! I really appreciate it. I am just learning how all this stuff works and I really appreciate the direction you have given!
    – user595035
    May 19, 2016 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.