DavidPostil is right in that you have to enclose the entire data string in double quotes, and then escape and double quotes inside the string to ensure it knows they are part of the string.
In this case the entire data string you want to add is:
xb'BV5!!!!!!!!!MKKSkEXCELFiles>VijqBof(Y8'w!FId1gLQ /dde /p "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" /e "%1"
So you want to wrap that entire string in double-quotes so that the command-line recognizes it as a single string (and not multiple arguments).
The trick is figuring out which quotes (and other characters) inside those delimiting quotes need to be escaped, and then figure out how to escape them for this context.
It took a little trial and error to figure it out, but for this case you only need to worry about the internal double-quotes, and you escape them by preceding them with a backslash (\
):
reg add "HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command" /v command /t REG_MULTI_SZ /d "xb'BV5!!!!!!!!!MKKSkEXCELFiles>VijqBof(Y8'w!FId1gLQ /dde /p \"C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE\" /e \"%1\""
Having said all that, and based on the problems that seem to be continuing with nailing it down exactly, I think Ramhound might have mentioned the best/easiest solution in his comment.
Just go to a machine with the settings set as you'd like, then export that key to a .reg
file.
Then use reg import
in your batch file to import that .reg file.
If you don't like using/distributing two files, and/or you don't have a central place you could put it on the network, then you could always have the batch file create the .reg file on the fly by echoing the lines out to a temporary text file, import it and then delete the temp file once done.
What's the actual error message you receive when you try to run it? – Ƭᴇcʜιᴇ007 – 2015-01-21T16:24:52.623
What makes you believe the syntax is wrong? Why don't you just modify the registry, export the change, and run exported change instead of doing a command that might contain syntax problems? – Ramhound – 2015-01-21T16:25:16.310