DarkPhoenix Posted July 16, 2004 Posted July 16, 2004 Hiya.In my RunOnceEx.cmd file (which we all know what is about, right?) I have these lines:REG ADD %KEY%\010 /VE /D "Microsoft Office" /fREG ADD %KEY%\010 /V 1 /D "%CDROM%\Applications\OfficeXP\Setup.exe TRANSFORMS=Unattended.MST /qb-" /fECHO @echo off > %windir%\install.cmdECHO CMDOW @ /HID >> %windir%\install.cmdECHO %CDROM% >> %windir%\install.cmdECHO cd \Applications\Proof >> %windir%\install.cmdECHO Setup.exe >> %windir%\install.cmdECHO exit >> %windir%\install.cmdREG ADD %KEY%\010 /V 2 /D " %windir%\install.cmd" /fnow, my question is... why does this last command there end up opening the root of my C: drive and not run Setup.exe like I tell it to? This is so bizarre to me that I cannot figure it out.
XtremeMaC Posted July 16, 2004 Posted July 16, 2004 put 2 more " around the "" the first "u have is for the reg entry and second u're going to put is for the command prompt to get the whole line..
evilvoice Posted July 16, 2004 Posted July 16, 2004 could be because he has a space between the first " and %windir%
DarkPhoenix Posted July 16, 2004 Author Posted July 16, 2004 *cough* -- wait a minute.. I just discovered something. It might not be important, but still... I have a space, right here:REG ADD %KEY%\010 /V 2 /D " %windir%\install.cmd" /fafter the first quote, see? That might be a problem. I don't know for sure though.
Guest zippy Posted July 16, 2004 Posted July 16, 2004 ECHO %CDROM% >> %windir%\install.cmdECHO cd \Applications\Proof >> %windir%\install.cmdtry make it like...ECHO CD /D %CDROM%\Applications\Proof >> %windir%\install.cmdsometimes i got trouble on change drive using %CDROM% on cmd file...
WwTIPPYwW Posted July 16, 2004 Posted July 16, 2004 what is all that extra stuff for? what is it doing?
DarkPhoenix Posted July 17, 2004 Author Posted July 17, 2004 You mean this part?ECHO @echo off > %windir%\install.cmdECHO CMDOW @ /HID >> %windir%\install.cmdECHO %CDROM% >> %windir%\install.cmdECHO cd \Applications\Proof >> %windir%\install.cmdECHO Setup.exe >> %windir%\install.cmdECHO exit >> %windir%\install.cmdREG ADD %KEY%\010 /V 2 /D "%windir%\install.cmd" /fThe ECHO lines actually make a cmd file that is like this:@echo offCMDOW @ /HIDD: (or whatever the %CDROM% variable is when it is applied)cd \Applications\ProofSetup.exeexitI do this because the AutoIt script that I use to install that stuff automatically requires to be in the same folder as the actual files.. for some reason. And since %CDROM% can change, so must the install.cmdOh yeah, btw, it solved once I removed that space from the beginning of the command.
WwTIPPYwW Posted July 17, 2004 Posted July 17, 2004 yes that part - thanks, but why couldn't you just use set the %CDROM% variable in the install.cmd file too?so it would look like this:@echo offCMDOW @ /HIDIF EXIST D:\CD.id set CDROM=D:IF EXIST E:\CD.id set CDROM=E:IF EXIST F:\CD.id set CDROM=F:%CDROM%\Applications\Proof\Setup.exeexitand if that is all that is really needed why do all the CD (change directory) stuff?
DarkPhoenix Posted July 17, 2004 Author Posted July 17, 2004 Well, the %CDROM% would most likely not change to the next boot, and your idea wouldn't work, cause it has to be IN the same directory as the actual program to work. So if you do "%CDROM%\Applications\Proof\Setup.exe" then it won't work, cause it will run from %windir%. (or at least I assume so, since install.cmd is in %windir%) That is what the CD is for, to change to the same directory as the Setup.exe file.
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