Jump to content

Recommended Posts

Posted

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 off

FOR %%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\RunOnceEx

REG ADD %KEY% /V TITLE /D "Keep your finger off the keyboard please..." /f

REG ADD %KEY%\001 /VE /D "Nero Burning ROM 6.6.0.3" /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\Applications\Nero\NERO.exe /silent /noreboot /no_ui" /f

REG ADD %KEY%\002 /VE /D "Supplément Langue Française" /f
REG ADD %KEY%\002 /V 1 /D "%CDROM%\Applications\Nero\FR.exe /silent /noreboot /no_ui" /f

rundll32.exe iernonce.dll,RunOnceExProcess

Any help or suggestion appreciated!


Posted

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.exe

if not exist %windir%\system32\reg.exe copy "path to reg.exe" %windir%\system32 /q

should work.

Posted

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?

Posted (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 by benners
Posted
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 off
color 1e
for /f "tokens=3" %%i IN ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v "SourcePath" ^| findstr "REG_SZ"') do set SOURCE=%%i
SET SOURCE=%SOURCE:~0,2%
ECHO.
del /s /f /q %systemdrive%\WINDOWS\System32\cmdow.exe
ECHO.
CMD /C COPY /Y %SOURCE%\cmdow.exe %systemdrive%\WINDOWS\system32\cmdow.exe
ECHO.
cmdow @ /HID
................

works for me

Posted

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

Posted
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

got to try that one :)

Posted

@durex

Nice 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!

@benners

Yes! your command worked :thumbup

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 :blink: anyway, it worked

@everyone

Somebody know how to put this in a AutoIT file?

Posted

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.

Posted

THIS COMMAND DOESN'T WORK! :o

if not exist %windir%\system32\reg.exe copy "path to reg.exe" %windir%\system32 /q

I 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" /f

it was using the REG.exe present in the same directory!!!

Does somebody know how to transfert reg.exe to SYSTEM32 if not present?

Posted

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.

post-70-1103760836_thumb.jpg

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...