Batch file unable to access Program files X86

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 Answers

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

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like