stuffman Posted May 27, 2004 Share Posted May 27, 2004 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 offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\001 /VE /D "PC Anywhere Version 11" /fREG ADD %KEY%\001 /V 1 /D "\\mycomputer\msi\pcanywhere\pcanywhere.msi" /f[B]REG ADD %KEY%\002 /VE /D "Adobe Acrobat Reader 6" /fREG 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" /fREG ADD %KEY%\003 /V 1 /D "\\mycomputer\msi\winzip9\winzip9.msi" /fREG ADD %KEY%\004 /VE /D "IBM i Series" /fREG ADD %KEY%\004 /V 1 /D "\\mycomputer\msi\iSeries\iseries.msi" /fREG ADD %KEY%\025 /VE /D "Microsoft Office 2000" /fREG ADD %KEY%\025 /V 1 /D "\\mycomputer\share\apps\productivity\msoffice\office2000\setup.exe TRANSFORMS=\\mycomputer\share\Apps\Productivity\MSOffice\Office2000\setup.MST /qb" /fREG ADD %KEY%\026 /VE /D "PC Anywhere Session Files" /fREG ADD %KEY%\026 /V 1 /D "\\mycomputer\share\batchfiles\pcanywheresession.bat" /fREG ADD %KEY%\027 /VE /D "Internet Explorer 6 SP1 Cumulative Update" /fREG 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" /fshutdown -lexitAny ideas on how to make the registry understand those spaces? Thanks,Shawn Link to comment Share on other sites More sharing options...
Alanoll Posted May 27, 2004 Share Posted May 27, 2004 REG ADD %KEY%\002 /V 1 /D "\\mycomputer\msi\acrobat6\acrobat6.msi INSTALLDIR=\"e:\Program Files\Adobe\Acrobat Reader\"" /f Link to comment Share on other sites More sharing options...
jondercik Posted May 27, 2004 Share Posted May 27, 2004 If you arehaving trouble with spaces set that string to a varibale before you use it.Example SET INSTALLDIR="c:\some folder name\other folder" Link to comment Share on other sites More sharing options...
Bâshrat the Sneaky Posted May 27, 2004 Share Posted May 27, 2004 REG ADD %KEY%\002 /V 1 /D "\\mycomputer\msi\acrobat6\acrobat6.msi INSTALLDIR=\"e:\Program Files\Adobe\Acrobat Reader\"" /f and /or (?) you could use double backslashes.e.g.: E:\\program files\\Adobe\\xyz Link to comment Share on other sites More sharing options...
Alanoll Posted May 27, 2004 Share Posted May 27, 2004 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 More sharing options...
stuffman Posted May 27, 2004 Author Share Posted May 27, 2004 You ROCK!I've been messing with that for days now. Thanks!Shawn Link to comment Share on other sites More sharing options...
Bâshrat the Sneaky Posted May 27, 2004 Share Posted May 27, 2004 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 /fhmmm..... I think I must be confused or so.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now