December 21, 200421 yr I am currently polishing my Unattended CD and one of the feature I am currently working on is the possibility to install the applications on my CD (for another computers for example) using the clean RunOnceEx interface.It works perfectly with the following code but I would like 2 more features:1) Add a function where it will look for REG.exe in SYSTEM32 and copy it over if not present (for Windows 2000)2) Convert this .cmd file to AutoIT so I can hide the command window. My attempt with AutoIT have been unsucessfull... @echo offFOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.bin SET CDROM=%%i:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Keep your finger off the keyboard please..." /fREG ADD %KEY%\001 /VE /D "Nero Burning ROM 6.6.0.3" /fREG ADD %KEY%\001 /V 1 /D "%CDROM%\Applications\Nero\NERO.exe /silent /noreboot /no_ui" /fREG ADD %KEY%\002 /VE /D "Supplément Langue Française" /fREG ADD %KEY%\002 /V 1 /D "%CDROM%\Applications\Nero\FR.exe /silent /noreboot /no_ui" /frundll32.exe iernonce.dll,RunOnceExProcessAny help or suggestion appreciated!
December 21, 200421 yr If you use cmdow.exe you can add cmdow @ /HID to the top of the batch which will hide the window.As for the reg.exeif not exist %windir%\system32\reg.exe copy "path to reg.exe" %windir%\system32 /q should work.
December 21, 200421 yr Author Thanks benner!cmdow.exe has to be present in SYSTEM32 before I launch this batch file and therefore it will show! Keep in mind I'll be using this CD on older machine... not always Unattended Installed!About the "path to reg.exe", if REG.exe is sitting in the same directory as the batch file do I have to specify an absolute path?
December 21, 200421 yr As far as I know if the exe is in the same dir as the cmd file you dont need to supply the absolute path, but if you know it I can't see any harm in being cautious Edited December 21, 200421 yr by benners
December 21, 200421 yr cmdow.exe has to be present in SYSTEM32 before I launch this batch file and therefore it will show! Keep in mind I'll be using this CD on older machine... not always Unattended Installed!you can use cmdow like this to @echo offcolor 1efor /f "tokens=3" %%i IN ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v "SourcePath" ^| findstr "REG_SZ"') do set SOURCE=%%iSET SOURCE=%SOURCE:~0,2%ECHO.del /s /f /q %systemdrive%\WINDOWS\System32\cmdow.exeECHO.CMD /C COPY /Y %SOURCE%\cmdow.exe %systemdrive%\WINDOWS\system32\cmdow.exeECHO.cmdow @ /HID................works for me
December 21, 200421 yr Well... it actually doesnt need to be in sys32 at all.. its simply recommended to place it there cause its in your path and can be executed from anywhere without including the location its in....you could simply keep cmdow on your uA cd, use the cdrom line to detect what drive your cd is on, then simply run %CDROM%\<path to cmdow>\cmdow @ /HID
December 21, 200421 yr you could simply keep cmdow on your uA cd, use the cdrom line to detect what drive your cd is on, then simply run %CDROM%\<path to cmdow>\cmdow @ /HIDgot to try that one
December 21, 200421 yr Author @durexNice Idea! But using this method, a window will appear for a few seconds until cmdow kick in ... right?EDIT: if cmdow.exe is in the same folder as the batch file do you think it can work without %CDROM% detection?RE-EDIT: Humm I think it is working! I'll double check!@bennersYes! your command worked I tested in Windows 2000 SP4 under VMware simulation... the strange thing is I did a search on the hard drive and I couldn't find reg.exe anyway, it worked@everyoneSomebody know how to put this in a AutoIT file?
December 22, 200421 yr Author Wohhaaa AutoIT is way too complicated for what I want to do.For those interested, I have found (on this forum ) a small program wich convert .cmd files to exeQuick Batch File CompilerIt seems to fit all my needs!
December 22, 200421 yr Obviously AutoIT and KIX share the same basic command structure, but keeping things nice and hidden is EXACTLY what WKIX32.EXE /I does.KIXSTART is a fairly good way to implement a large number of these scripts in a much cleaner light, and do useful things like trap the error codes, create logs, etc.
December 22, 200421 yr Author THIS COMMAND DOESN'T WORK! if not exist %windir%\system32\reg.exe copy "path to reg.exe" %windir%\system32 /qI tought it was working because REG.exe was in the same directory as my Batch File and when I was executing code like:REG ADD %KEY%\zz01 /VE /D "Adobe Reader" /fit was using the REG.exe present in the same directory!!! Does somebody know how to transfert reg.exe to SYSTEM32 if not present?
December 22, 200421 yr Author Ok! GOT IT NOW!I had to remove the /q at the end like this:if not exist %windir%\system32\reg.exe copy "path to reg.exe" %windir%\system32
December 22, 200421 yr for a couple of days now I hv been using WPI on a seperate cd to install applications. It is fantastic. pls view the wpi thread.at the root of my cd/dvd i hv the wpi.hta (wpi is launch from here similar to setup.exe) i even hv a autorun.inf so it auto launches when inserted into a drive.the advantage over runonceEX.cmd is that u can pre define what u want to install.and if u change your mind u can deselect what u dont want or want from the list.
December 22, 200421 yr Cmon Asta.. Im nearly finished my master uA cd and you gotta toss this cool thing in my face... Youre killin me!
Create an account or sign in to comment