Jump to content

Inject .bat file into installation


tsolaaa

Recommended Posts

Hey Guys, 

 

I need to inject a batch file into the all-in-one setup. 

 

I am using the ISO that is created by WinTool Kit over a PXE server so the silent installs set inside the app do not run like they should. 

 

Instead, I have told the app to place the files in the c:/ directory and then I would like to somehow have my install run my batch script to run the installs automatically. 

 

I have been unable to find any solutions yet. 

 

Maybe a custom .reg file inserted into the tweaks section that tells the OS to run the .bat file on the first startup?

 

Anyone have any suggestions?

Link to comment
Share on other sites

sources/$OEM$/$$/Setup/scripts/SetupComplete.cmd

 

Thank you! 

 

But where exactly do I edit this?

 

That path doesn't exist inside the extracted ISO I am using WinToolKit with. 

 

If this helps, I am using SERVA to deploy the installs over PXE. 

 

The SERVA root folder has "/$OEM$/$$" should I create the "setup/scripts/" and just add the batch file there and rename it to "SetupComplete.cmd" ?

Link to comment
Share on other sites

yes

 

the root folder go to Windows/Setup (folder already exist when you extracted the iso) but create "S"etup with big s, sometimes syntax is important...

 

or create scripts/SetupComplete.cmd in Windows/Setup folder directly in your iso.

 

 

 

 

important: SetupComplete.cmd works when "setup is checking video performance" comes silently but some tweaks needs to run after for works. If you want run bat file after welcome screen, it's possible to put this command in SetupComplete.cmd (mybat.bat is our bat file in Setup\scripts folder)

 

cmdow @ /HID

 
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
 
REG ADD %KEY% /V TITLE /D "Install bat..." /f
 
 
REG ADD %KEY%\001 /VE /D "Install bat" /f
REG ADD %KEY%\001 /V 1 /D "%systemroot%\Setup\scripts\mybat.bat" /f
Exit
Edited by kalimergo
Link to comment
Share on other sites

 

yes

 

the root folder go to Windows/Setup (folder already exist when you extracted the iso) but create "S"etup with big s, sometimes syntax is important...

 

or create scripts/SetupComplete.cmd in Windows/Setup folder directly in your iso.

 

 

 

 

important: SetupComplete.cmd works when "setup is checking video performance" comes silently but some tweaks needs to run after for works. If you want run bat file after welcome screen, it's possible to put this command in SetupComplete.cmd (mybat.bat is our bat file in Setup\scripts folder)

 

cmdow @ /HID

 
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
 
REG ADD %KEY% /V TITLE /D "Install bat..." /f
 
 
REG ADD %KEY%\001 /VE /D "Install bat" /f
REG ADD %KEY%\001 /V 1 /D "%systemroot%\Setup\scripts\mybat.bat" /f
Exit

 

 

I'm sorry, I don't fully understand. 

 

When I extract the ISO there is no "Windows" folder. There is a "Sources" folder. 

 

I'm using WinTool Kit to integrate everything and SERVA to deploy over PXE. 

 

I tried using the "Files" tab inside the application to place the SetupComplete.cmd file inside "C:\Windows\Setup\Scripts" but it is still not running. 

I have checked the log file and it doesn't even attempt to run it. Maybe it's placing the file after windows looks for it?

 

I just tried placing the SetupComplete.cmd inside the "$OEM$\$$\Setup\Scripts" within the SERVA root directory and it still doesn't run. 

 

Where do I place all those registry entries and where do I place them inside the WinTool Kit App?

Link to comment
Share on other sites

Okay one solution:

 

 

1- create in sources directory this 4 folders.   ($OEM$/$$/Setup/scripts)

2- create SetupComplete.cmd in scripts folder with this lines

 

cmdow @ /HID

 
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
 
REG ADD %KEY% /V TITLE /D "Install bat..." /f
 
 
REG ADD %KEY%\001 /VE /D "Install bat" /f
REG ADD %KEY%\001 /V 1 /D "%systemroot%\Setup\scripts\mybat.bat" /f
Exit
 
3- rename your bat file as "mybat.bat" and put it in scripts directory too
Edited by kalimergo
Link to comment
Share on other sites

 

Okay one solution:

 

 

1- create in sources directory this 4 folders.   ($OEM$/$$/Setup/scripts)

2- create SetupComplete.cmd in scripts folder with this lines

 

cmdow @ /HID

 
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
 
REG ADD %KEY% /V TITLE /D "Install bat..." /f
 
 
REG ADD %KEY%\001 /VE /D "Install bat" /f
REG ADD %KEY%\001 /V 1 /D "%systemroot%\Setup\scripts\mybat.bat" /f
Exit
 
3- rename your bat file as "mybat.bat" and put it in scripts directory too

 

 

 

So I tried both methods above. 

 

I first put these files into the correct directory inside the \Sources\Scripts\...in the deployment folder. 

 

I also opened the install.wim and placed the files actually inside the c:\Windows\Setup\Scripts

 

Both have no effect. 

 

There is nothing in Setupact.txt log either....

 

Maybe the UAC is preventing the applications from installing automatically? 

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...