Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL Server
Hi All,
How to install powershell and sql server 2008 r2 silent from same batch file.
 
my batch file code is....
 
cd\
cd nirali
cd xp_powershell
WindowsXP-KB926139-v2-x86-ENU.exe /quiet /passive /norestart 
ping 127.0.0.1>nul
 
cd\
cd Windows
cd system32
powershell.exe "c:\nirali\SQLEXPRADV2008_x86_ENU.exe /CONFIGURATIONFILE=c:\nirali\ConfigurationFile.ini /INDICATEPROGRESS"
 
successed to install Powershell but not able to install sql server....
want to install both in same batch file...
 
Thanks in advance...thanks a lot for your help...
Posted 15-Oct-12 2:49am
Edited 15-Oct-12 21:15pm
v2
Comments
ronak123456 at 15-Oct-12 7:58am
   
if i run both batch file one by one .. then it installs fine.. no need to restart pc after installation of powershell... it creates issue when using both script in same batch file... :(

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can't because powershell needs system restart :(
  Permalink  
Comments
ronak123456 at 15-Oct-12 7:52am
   
so is there any solution for the same??
Zoltán Zörgő at 15-Oct-12 8:00am
   
It depends why you want this. Do you install sql server so often, that a manual restart and continuation is not acceptable? Than use an install builder, that can handle prerequisites and postponed installation.
ronak123456 at 15-Oct-12 8:50am
   
Thank u very much for your reply...please suggest me what can i do for the same? please.....
Zoltán Zörgő at 15-Oct-12 9:05am
   
Many bootstappers and install utils can do this, look here for example:
http://shieldmaster.wordpress.com/2009/04/26/tutorial-adding-setup-prerequisites-to-installshield-package/
(http://msdn.microsoft.com/en-us/library/aa730839(v=vs.80).aspx)
ronak123456 at 15-Oct-12 9:35am
   
sorry but not getting any idea from this link.. :(
 
Zoltán Zörgő at 15-Oct-12 9:38am
   
Again: why do you need this at all?
ronak123456 at 16-Oct-12 1:19am
   
I want to install sql server 2008 r2 slient from my setup file on XP ... and to install sql server 2008 r2 express it needs powershell... so i want to include both files in same setup file. for that i have created 1 batch file for the commands that installs powershell and sql server...
Zoltán Zörgő at 16-Oct-12 2:23am
   
I could imagine that. But why from batch? Why is a reboot problematic? And why are u using powershell to run the sql server installer? Anyway... try this:

@echo off
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v SQLEXPRADV2008_x86_ENU /t REG_SZ /d "c:\nirali\SQLEXPRADV2008_x86_ENU.exe /CONFIGURATIONFILE=c:\nirali\ConfigurationFile.ini /INDICATEPROGRESS"
 
c:\nirali\cd xp_powershell\WindowsXP-KB926139-v2-x86-ENU.exe /passive /forcereboot

It will add the server installer to the registry to start after reboot, install powershell and reboot
ronak123456 at 16-Oct-12 7:09am
   
:) :) Thanks a lot for your help and it works.. i only change my code in batch file as below with your help...
 
cd\
cd nirali
cd xp_powershell
WindowsXP-KB926139-v2-x86-ENU.exe
 
@echo off
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v SQLEXPRADV2008_x86_ENU /t REG_SZ /d "c:\nirali\SQLEXPRADV2008_x86_ENU.exe /CONFIGURATIONFILE=c:\nirali\ConfigurationFile.ini /INDICATEPROGRESS"
 
it rocks !!!!!! works!!!! thanks a lot again..
Zoltán Zörgő at 16-Oct-12 8:11am
   
You are welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 BillWoodruff 330
1 Mathew Soji 309
2 Maciej Los 295
3 DamithSL 225
4 Afzaal Ahmad Zeeshan 217
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,025


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100