war59312 Posted November 12, 2008 Share Posted November 12, 2008 Hello,I'm trying to run a batch file via unOnceEx from CMDLINES.Here is my current CMDLINES file:[COMMANDS]"REGEDIT /S AllUsers.reg""REGEDIT /S CurrentUser.reg""REGEDIT /S DriveIcons.reg""REGEDIT /S folderSetUp.reg""REGEDIT /S Fonts.reg""REGEDIT /S icons.reg""REGEDIT /S IE.reg""REGEDIT /S MediaPlayer.reg""REGEDIT /S MyComputerMenu.reg""REGEDIT /S RegistryFavorites.reg""REGEDIT /S removeContextMenus.reg""REGEDIT /S Services.reg""REGEDIT /S TaskManger.reg""REGEDIT /S TCPIP.reg""REGEDIT /S Theme.reg""REGEDIT /S ToolBar.reg""REGEDIT /S WMPAssociations.reg""REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /V AutoOrder /D autoorder.vbs /F""SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx""REG ADD %KEY% /V TITLE /D "Custom Windows Setup" /f""REG ADD %KEY%\055 /VE /D "First Run Settings" /f""REG ADD %KEY%\055 /V 1 /D "%windir%\system32\hide.exe /w "%systemdrive%\install\Update.cmd"" /f"The last four lines seem to have no effect. Nothing is added to RunOnceEx. See a typo somewhere? Any ideas?Thanks for the help,Will Link to comment Share on other sites More sharing options...
HØLLØW Posted November 13, 2008 Share Posted November 13, 2008 I think the RunOnceEx must be a .cmd file?! So you must run the "RunOnceEx.cmd" from the "cmdlines.txt" and not in it.[COMMANDS]"RunOnceEx.cmd"The "cmdlines.txt" and the "RunOnceEx.cmd" must be in the same folder on the CD/DVD. Link to comment Share on other sites More sharing options...
war59312 Posted November 13, 2008 Author Share Posted November 13, 2008 Hey,Yeah I tried that, no luck. Batch will run fine, but nothing gets added to RunOnceEx. Seems like a Windows bug or something.. In fact I just tried this simple test..winnt.sif[GuiRunOnce] "%windir%\system32\hide.exe /w %systemdrive%\install\FIRSTRUN.cmd"FIRSTRUN.cmd@ECHO OFFTITLE Preparing Custom Windows InstallSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Custom Windows Setup" /fREG ADD %KEY%\010 /VE /D "First Run Settings" /fREG ADD %KEY%\010 /V 1 /D "%windir%\system32\hide.exe /w "%systemdrive%\install\Update.cmd"" /fECHO.EXITUpdate.cmd never runs, it does not get added to RunOnceEx Very strange..cya,Will Link to comment Share on other sites More sharing options...
0d14r3 Posted November 13, 2008 Share Posted November 13, 2008 (edited) » Applications that use QuotationsYou will find that if you add additional " " quotation marks in the REG ADD entries, it won't be imported to the Windows Registry. To work around this, use a backslash \" for every quotation you intend to add, for example:%KEY%\005 /V 1 /D "\"%systemdrive%\install\AdobeReader6\Adobe Reader 6.msi\" /qn" /fBy doing this, you can execute applications that contain spaces in the filename, or application switches that need to be enclosed in quotations.If there is an application that has a series of complicated switches with lots of quotation marks, consider putting them into a separate .cmd file instead and launching from RunOnceEx, because it would get too messy putting those switches directly into RunOnceEx.From here. Edited November 13, 2008 by 0d14r3 Link to comment Share on other sites More sharing options...
war59312 Posted November 13, 2008 Author Share Posted November 13, 2008 Well I be darn; glad it was something simple! Working excellent now.. Thanks buddy!! Link to comment Share on other sites More sharing options...
war59312 Posted November 14, 2008 Author Share Posted November 14, 2008 (edited) Hello,Well, something else is going on now..Here is the simple batch file I'm using:@ECHO OFFTITLE Finishing Custom Windows InstallSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Finishing Custom Windows Install" /fREG ADD %KEY%\030 /VE /D "Installing Applications" /fREG ADD %KEY%\030 /V 1 /D "%windir%\system32\hide.exe /w \"%systemdrive%\install\finish\appz.cmd\"" /fREG ADD %KEY%\035 /VE /D "Removing Unused Folders" /fREG ADD %KEY%\035 /V 1 /D "%windir%\system32\hide.exe /w \"%systemdrive%\install\finish\unused.cmd\"" /fREG ADD %KEY%\040 /VE /D "Applying Registry Settings" /fREG ADD %KEY%\040 /V 1 /D "%windir%\system32\hide.exe /w \"%systemdrive%\install\finish\registry.cmd\"" /fREG ADD %KEY%\045 /VE /D "Rebooting To Finish Install" /fREG ADD %KEY%\045 /V 1 /D "%windir%\system32\hide.exe /w \"%systemdrive%\install\finish\cleanup.cmd\"" /fREG ADD %KEY%\050 /VE /D "Deleting Install Directory" /fREG ADD %KEY%\050 /V 1 /D "%windir%\system32\hide.exe /w \"%systemdrive%\install\finish\done.cmd\"" /fREG ADD "HKCR\Folder\shell\List Contents\command" /ve /d "hide.exe %COMSPEC% /C DIR ""%%1\"" /B /O /S>""%%1\""\"_CONTENTS LIST.TXT"" /fECHO.EXITOddly enough, the title is never added to the registry. Does not matter what the title is; I know it's not spaces.If I simply double click on the batch file the title is added correctly. Yet when it is run from a different batch file the title never gets add. It shows up as "Windows Update" when ran. Really weird!Thanks again,Will Edited November 14, 2008 by war59312 Link to comment Share on other sites More sharing options...
Yzöwl Posted November 14, 2008 Share Posted November 14, 2008 Because you're running a batch file, the file is read before it is run and it's during this read that one or more errors are encountered.Are you sure that you're happy with the list contents portion of the script? Link to comment Share on other sites More sharing options...
ZileXa Posted November 16, 2008 Share Posted November 16, 2008 if you install ie7 or use a ie7 add on, that could kill your runonceex entries in the registry, so runonceex will never run. Link to comment Share on other sites More sharing options...
war59312 Posted November 16, 2008 Author Share Posted November 16, 2008 Hi,Yzöwl, I wonder what errors then?Yes list contents seems to be working as expected, why? Better idea?ZileXa, thanks for the input but nope no IE 7, just good old IE 6 SP3.Thanks to both of you,Will Link to comment Share on other sites More sharing options...
Yzöwl Posted November 16, 2008 Share Posted November 16, 2008 Yes list contents seems to be working as expectedThat's amazing, because your syntax is wrong!I don't know the hide.exe program your using but I'd guess from what you've got that you should need something like this:Reg add "HKCR\Folder\shell\List Contents\command" /ve /d "Hide.exe %%ComSpec%% /c Dir/b/o/s \"%%~1\">\"%%~1\_CONTENTS LIST.TXT\"" /f...all on one line!You may also find this old topic useful Link to comment Share on other sites More sharing options...
war59312 Posted November 17, 2008 Author Share Posted November 17, 2008 Um, when I try that I get:The system cannot find the path specified.hide.exe hides the cmd window so it does not even blink Link to comment Share on other sites More sharing options...
Yzöwl Posted November 17, 2008 Share Posted November 17, 2008 This is what ends up in my registry:@Echo offTitle Finishing Custom Windows InstallSet "R_=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx"Set "D_=HKLM\SOFTWARE\Classes\Folder\shell\Pist Contents"Set "W_=%%SystemRoot%%\system32"Set "S_=%%SystemDrive%%\install"Reg add %R_% /v Title /d "Finishing Custom Windows Install" /fReg add %R_%\030 /ve /d "Installing Applications" /fReg add %R_%\030 /v 1 /d "%W_%\hide.exe /w \"%S_%\finish\appz.cmd\"" /fReg add %R_%\035 /ve /d "Removing Unused Folders" /fReg add %R_%\035 /v 1 /d "%W_%\hide.exe /w \"%S_%\finish\unused.cmd\"" /fReg add %R_%\040 /ve /d "Applying Registry Settings" /fReg add %R_%\040 /v 1 /d "%W_%\hide.exe /w \"%S_%\finish\registry.cmd\"" /fReg add %R_%\045 /ve /d "Rebooting To Finish Install" /fReg add %R_%\045 /v 1 /d "%W_%\hide.exe /w \"%S_%\finish\cleanup.cmd\"" /fReg add %R_%\050 /ve /d "Deleting Install Directory" /fReg add %R_%\050 /v 1 /d "%W_%\hide.exe /w \"%S_%\finish\done.cmd\"" /fReg add "%D_%\command" /ve /d ^ "Hide.exe %%ComSpec%% /c Dir/b/o/s %%1>\"%%~1\_CONTENTS LIST.TXT\"" /f Link to comment Share on other sites More sharing options...
war59312 Posted November 28, 2008 Author Share Posted November 28, 2008 (edited) Thanks again for your help!!I have attached hide.exe so you know what it is..HIDE.EXEUsing my code should produce:Hide.exe %ComSpec% /c Dir/b/o/s "C:\Program Files">"C:\Program Files\_CONTENTS LIST.TXT"And if I run that in a command window then it creates an empty (0 bytes) file called _CONTENTS LIST in C:\Program Files .The following installs without problem on my system:Thanks for that idea.. Edited November 28, 2008 by war59312 Link to comment Share on other sites More sharing options...
Yzöwl Posted November 29, 2008 Share Posted November 29, 2008 Thanks, although I'm sure you misunderstood me. I know exactly what it does, I simply have no wish now or ever to use such a thing.I find it completely unnecessary to prevent a window flashing on the screen during an unattended installation. First of all the idea of unattended is that you don't have to sit there during the installation, so you wont see anything happen. Secondly for those who do sit there, flashing windows may help prove that something is actually happening!What I actually meant was that because I didn't have a working knowledge of Hide.exe, I wasn't sure if for instance all of its parameters needed double quoting. Link to comment Share on other sites More sharing options...
ZileXa Posted November 29, 2008 Share Posted November 29, 2008 You can use my RunOnceEx as reference/example. I also use hide.exe among other things. Using hide.exe because when I started unattended I was all about making the installation look as clean as possible. Don't care now but never changed it. 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