Jump to content

Support for spaces in RunOnceEx - Quotations?


Recommended Posts

Hi everybody,

i'm having a hard time getting spaces to work in a batch file I'm using to add commands to RunOnceEx in the registry. Our organization requires us to install all programs to e:\Program Files\... and I need to use the INSTALLDIR= parameter after the Adobe Acrobat pathname, but I can't figure out how to make the windows registry understand the space between the word 'program' and 'files'. Normally I'd use quotes, but since it's already enclosed in quotes it sees the first quote as the end of the statement and gives me an error. I tried running a batch file that creates the directory Adobe will live in, then installing to e:\Progra~1\.... but that created a folder named 'Progra~1' on the E:\ drive. Here's the batch file I'm using:

cmdow /HID
@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%\001 /VE /D "PC Anywhere Version 11" /f
REG ADD %KEY%\001 /V 1 /D "\\mycomputer\msi\pcanywhere\pcanywhere.msi" /f
[B]
REG ADD %KEY%\002 /VE /D "Adobe Acrobat Reader 6" /f
REG ADD %KEY%\002 /V 1 /D "\\mycomputer\msi\acrobat6\acrobat6.msi INSTALLDIR=e:\Program Files\Adobe\Acrobat Reader\" /f
[/B]
REG ADD %KEY%\003 /VE /D "Winzip 9.0" /f
REG ADD %KEY%\003 /V 1 /D "\\mycomputer\msi\winzip9\winzip9.msi" /f

REG ADD %KEY%\004 /VE /D "IBM i Series" /f
REG ADD %KEY%\004 /V 1 /D "\\mycomputer\msi\iSeries\iseries.msi" /f

REG ADD %KEY%\025 /VE /D "Microsoft Office 2000" /f
REG ADD %KEY%\025 /V 1 /D "\\mycomputer\share\apps\productivity\msoffice\office2000\setup.exe TRANSFORMS=\\mycomputer\share\Apps\Productivity\MSOffice\Office2000\setup.MST /qb" /f

REG ADD %KEY%\026 /VE /D "PC Anywhere Session Files" /f
REG ADD %KEY%\026 /V 1 /D "\\mycomputer\share\batchfiles\pcanywheresession.bat" /f

REG ADD %KEY%\027 /VE /D "Internet Explorer 6 SP1 Cumulative Update" /f
REG ADD %KEY%\027 /V 1 /D "\\mycomputer\share\Apps\Internet\IE6SP1\ie6setup.exe /q /r:n" /f

;REG ADD %KEY%\028 /VE /D "Post-Install Cleanup" /f
;REG ADD %KEY%\028 /V 1 /D "\\mycomputer\share\batchfiles\PostInstallCleanup.bat" /f

shutdown -l

exit

Any ideas on how to make the registry understand those spaces?

Thanks,

Shawn

Link to comment
Share on other sites


I've never seen \\ in a REG command when refering to directories and spaces. Network drives yes, not spaces.. In any case, the original was flawed.

There would be a " after READER if he looked in the registry along with /f

Link to comment
Share on other sites

I've never seen \\ in a REG command when refering to directories and spaces. Network drives yes, not spaces.. In any case, the original was flawed.

There would be a " after READER if he looked in the registry along with /f

hmmm..... I think I must be confused or so.... :D:rolleyes::)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...