Jump to content

Runing bat file after Windows XP instalation


EmZvr

Recommended Posts

Hi everyone. I finished my XP SP3 customization and integrated drivers via DriverPack. The only thing I don't know hot to do is: How can I made a bat file to start after the windows instalation is finished. I read the explanation in the MSFN Unattended Instalation guide but I can't get it. Here's what I want to do.

I made the bat file but it's ok. Ut should do this: 1. Delete all shortcuts in from the desktop 2. Copy some files from the CD to C:\WINDOWS\System32 (calc.exe, iis.dll, iis.ini, oeminfo.inf) 3. Apply registry tweaks in the file Tweaks.reg 4. Restart the computer. And here's how I did it:

cmdow @ /HID

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."

del %systemdrive%\Users\EmZvr\Desktop\*.ink

copy %SOURCE%\Tweaks\*.* %systemdrive%\WINDOWS\System32

REG ADD %KEY% /V 1 /D "REGEDIT /S %SOURCE%\Tweaks\tweaks.reg" /f

EXIT

Is it correct ? And where should I put the bat file and the files that must be copied in the system32 folder ?

Thanks in advance

Link to comment
Share on other sites


You need to read that guide again, you should have:

a folder named $OEM$ in your Setup files with these in it:

1. $$ folder with a System32 folder with cmdow.exe inside that

2. Software folder (or whatever you want as long as you put it in the RunOnceEx.cmd) where you want all the apps to get copied or installed

3. cmdlines.txt with this:

[COMMANDS]

"RunOnceEx.cmd"

4. a RunOnceEx.cmd with something like this:

cmdow @ /HID

@echo off

SetLocal enableextensions

SET CDROM=%~d0

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\001 /V 1 /D "%CDROM%\$OEM$\Software\##Location to your .bat file or you can possibly add what you have in your .bat file here (Not done what your doing so not really sure)

EndLocal

EXIT

Hope that helps ...

[EDIT]

Why are you trying to copy the oeminfo.inf file to the system32 folder in Windows? I'm pretty sure that stays on the cd and is not used by the OS, its only used during setup.

Edited by mazmorbid
Link to comment
Share on other sites

mazmorbid Thanks alot for the help. From what I understand I did this. In the cd I have a folder $OEM$ which has cmdlines.txt (which has: [Commands] "rundll32 advpack.dll,LaunchINFSection nLite.inf,U"

"RunOnceEx.cmd" ), RunOnceEx.cmd (which has:

cmdow @ /HID

@echo off

SetLocal enableextensions

SET CDROM=%~d0

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\001 /V 1 /D "%CDROM%\$OEM$\Software\Tweaks.reg

EndLocal

EXIT

) and a folder $$ which has System32( with cmdow.exe in it) and the folder Software( which has all the files that should be copied and the Tweaks.reg)

I think it's ok but It will only add the tweaks.reg to the registry but what command to add that will copy the files :/

The file oeminfo adds a button in my coputer's properties "Support Insformation" which holds a information about your computer.

p.s. It's really difficult to express what i want to say in English :/

Link to comment
Share on other sites

Sorry i did miss read and thought i saw oobeinfo :blushing: oops .. Try adding this into your RunOnceEx.cmd to copy oeminfo.inf into the system32 folder:

copy %CDROM%\$OEM$\Software\oeminfo.inf %systemroot%\system32\

Edited by mazmorbid
Link to comment
Share on other sites

actually with your oeminfo.inf file I think it also works without putting any entry into the .bat file .. all you need to do is put your oeminfo.inf into $OEM$ -> $$ -> System32 folder and it gets copied onto your system drive??

Link to comment
Share on other sites

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