Incroyable HULK Posted December 21, 2004 Posted December 21, 2004 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!
benners Posted December 21, 2004 Posted December 21, 2004 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.
Incroyable HULK Posted December 21, 2004 Author Posted December 21, 2004 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?
benners Posted December 21, 2004 Posted December 21, 2004 (edited) 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, 2004 by benners
sixpack Posted December 21, 2004 Posted December 21, 2004 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
durex Posted December 21, 2004 Posted December 21, 2004 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
benners Posted December 21, 2004 Posted December 21, 2004 you could simply keep cmdow on your uA cd nice one! never thought of that.
sixpack Posted December 21, 2004 Posted December 21, 2004 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
Incroyable HULK Posted December 21, 2004 Author Posted December 21, 2004 @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?
Incroyable HULK Posted December 22, 2004 Author Posted December 22, 2004 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!
mythosaz Posted December 22, 2004 Posted December 22, 2004 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.
Incroyable HULK Posted December 22, 2004 Author Posted December 22, 2004 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?
Incroyable HULK Posted December 22, 2004 Author Posted December 22, 2004 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
Astalavista Posted December 22, 2004 Posted December 22, 2004 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.
durex Posted December 22, 2004 Posted December 22, 2004 Cmon Asta.. Im nearly finished my master uA cd and you gotta toss this cool thing in my face... Youre killin me!
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