Jump to content

how to abort installation of a program run from .c


Recommended Posts

@ECHO OFF
ECHO Please wait as applications are installed. This may take several minutes.
ECHO

ECHO.
ECHO Installing Sun Java VM 5.0.1
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\jre501.exe

ECHO.
ECHO Installing VB Runtime 6.0
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\vb6.exe /silent

ECHO.
ECHO Installing .Net 1.1 SP1
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\netsp1.exe

ECHO.
ECHO Installing Office XP Professional
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\OfficeXP\setup.exe TRANSFORMS=oxp.MST /qb-


ECHO.
ECHO Installing Avant Browser 9.35
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\avant.exe /S


ECHO.
ECHO Installing Adobe Reader 7.0
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\acro7.exe


ECHO.
ECHO Installing Quicktime Alternative 1.3.9
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\quicktimealt138.exe /VERYSILENT /SP-

ECHO.
ECHO Installing Real Alternative 1.2.9
ECHO Please wait...
start /wait %systemdrive%\backup\winapp\prog\realalt129.exe /VERYSILENT /SP-

ECHO.
ECHO Applying Registry Tweak ver 1.0...
REGEDIT /S %systemdrive%\backup\winapp\Regedit.reg

ECHO.
ECHO Applying Nero Registry Tweak
REGEDIT /S %systemdrive%\backup\winapp\nero.reg

REM ftype will also show all registered types
assoc .blt=txtfile
assoc .cue=txtfile
assoc .diz=txtfile
assoc .eml=txtfile
assoc .iss=txtfile
assoc .log=txtfile
assoc .md5=txtfile
assoc .nbi=txtfile
assoc .nfo=txtfile
assoc .nt=txtfile
assoc .pif=txtfile
assoc .sam=txtfile
assoc .sif=txtfile
assoc .sfv=txtfile
assoc *=txtfile


Echo.
Echo Resetting PC, Please wait....
sshutdown -r -t 30 -f -m "Windows XP will now restart in 30 Seconds..."

here's part of my .cmd file to install program on first logon.

i' was wondering if there's code to give user permission to abort installation of a program?

exactly, i want to have option to skip installation of officexp and move on to next one.. way to trigger it would be display "press any key to skip installation" and show it for 5 seconds or so, and if input is given, skip, if not install officexp.

i lack programing skills to find this out, i did search for it, but nothing exactly like this exists.. so i ask for help to all you gurus :)

thank you in advance. i'd like to offer gmail acct or something for gratitude, but i don't have any atm :(

Link to comment
Share on other sites


Here is a vbs that uses the WsPopup

It Has A Built In Timer

Yes Button = Set To Run A Radio Station

Green Is Your Code To Install

Wont Run With These '

'    Set oWS = WScript.CreateObject("WScript.Shell")

'    oWS.Run SD & "\backup\winapp\prog\jre501.exe"

'    wscript.sleep 100

Will Run ' Are Removed And It Will Run

    Set oWS = WScript.CreateObject("WScript.Shell")

    oWS.Run SD & "\backup\winapp\prog\jre501.exe"

    wscript.sleep 100

Purple Is Text And Is Safe To Change Or Delete

Red Only Edit If You Know What You Are Doing

Blue Are Varibles These Are For The Script, Edit Them If Needed Use Caution

Orange Is Safe To Remove From Script

Set WshShell = CreateObject("WScript.Shell")

Z = Chr(95)

Y = Chr(213)

X = Chr(191)

W = Chr(214)

V = Vbcrlf

U = Chr(123)

T = Chr(125)

S = Chr(71)

R = Chr(83)

Q = Chr(77)

Wscript.Sleep 150

On Error Resume Next

Dim Shell, AP, UP, SD, WD, SP , SDI

Set Shell = WScript.CreateObject("WScript.Shell")

AP  = Shell.ExpandEnvironmentStrings("%AllUsersProfile%\")

UP  = Shell.ExpandEnvironmentStrings("%UserProfile%\")

SD  = Shell.ExpandEnvironmentStrings("%SystemDrive%\")

WD  = Shell.ExpandEnvironmentStrings("%windir%\")

SP  = Shell.ExpandEnvironmentStrings("%SystemDrive%\Program Files\")

SDI = Shell.ExpandEnvironmentStrings("%SystemDrive%\Install\")

B  = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Hello And Lets Begin"

B1 = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Good Bye ??"

C = "Would You Like To Install " & V & "Sun Java VM 5.0.1" & V

C1 = "1\YES" & V & space(5) & "Sun Java VM 5.0.1"& V

C2 = "2\NO" & V & space(5) & "Will Not Install Sun Java VM 5.0.1" & V

C4 = "Time Out" & V & space(5) & "If Nothing Pressed"& V & space(5) &"Then The Defualt Action Is To Install!"& V

SN = "Preparing For Next"

intButton = WshShell.Popup ( "Click a button to proceed." & V & B & V & C & V & C1 & V & C2 & V & C4 ,12 ,  "Test" ,4 + 48)

  select case intButton

''''''''''TIME OUT ACTION

  case -1

TimeOut= WshShell.Popup ( "No Selection Was Made"   & V  &   "Preparing Defualt Action" , 3, "Time Out Action" , 0 +64 )

WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48

  Set oWS = WScript.CreateObject("WScript.Shell")

  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"

'    Set oWS = WScript.CreateObject("WScript.Shell")

'  WshShell.Popup "Preparing Sun Java VM 5.0.1",3 , "Sun Java VM 5.0.1",0+48

'    oWS.Run SD & "\backup\winapp\prog\jre501.exe"

'    wscript.sleep 100

WshShell.Popup B1 , 4 , ""& SN , 0 + 64

''''''''''TIME OUT ACTION

''''''''''YES ACTION 

  case 6

YesRes = WshShell.Popup (   "Yes Was Selected" & V &  "Preparing Install Of " , 4, "Install APP" , 0 +64 )

WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48

  Set oWS = WScript.CreateObject("WScript.Shell")

  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"

'    Set oWS = WScript.CreateObject("WScript.Shell")

'  WshShell.Popup "Preparing Sun Java VM 5.0.1",3 , "Sun Java VM 5.0.1",0+48

'    oWS.Run SD & "\backup\winapp\prog\jre501.exe"

'    wscript.sleep 100

WshShell.Popup B1 , 4 , ""& SN , 0 + 64

''''''''''YES ACTION

''''''''''NO ACTION

  case 7

    SN = "No Was Pressed" & V & "Stopping The Install" & V & "Preparing For Next"

  NoRes = WshShell.Popup ( "No Was Selected" & V & B1 , 4, "" & SN , 0 +64 )

''''''''''NO ACTION 

  end select

  Wscript.quit

New Entry

ECHO.

ECHO Installing Sun Java VM 5.0.1

ECHO Please wait...

start /w  %systemdrive%\backup\winapp\prog\SunJavaVM.vbs

Old Entry

ECHO.

ECHO Installing Sun Java VM 5.0.1

ECHO Please wait...

start /wait %systemdrive%\backup\winapp\prog\jre501.exe

Edited by gunsmokingman
Link to comment
Share on other sites

Try This

start/w %sysyemdrive%\WMP10\MP10Setup.exe /q:A /c:"setup_wm.exe /Q /R:N /DisallowSystemRestore"

set WshShell = CreateObject("WScript.Shell")

Z = Chr(95)

Y = Chr(213)

X = Chr(191)

W = Chr(214)

V = Vbcrlf

U = Chr(123)

T = Chr(125)

S = Chr(71)

R = Chr(83)

Q = Chr(77)

Wscript.Sleep 150

On Error Resume Next

Dim Shell, AP, UP, SD, WD, SP , SDI

Set Shell = WScript.CreateObject("WScript.Shell")

SD  = Shell.ExpandEnvironmentStrings("%SystemDrive%\")

B  = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Hello And Lets Begin"

B1 = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Good Bye ??"

C = "Would You Like To Install " & V & "WMP 10" & V

C1 = "1\YES" & V & space(5) & "WMP 10"& V

C2 = "2\NO" & V & space(5) & "Will Not Install WMP 10" & V

C4 = "Time Out" & V & space(5) & "If Nothing Pressed"& V & space(5) &"Then The Defualt Action Is To Install!"& V

SN = "Preparing For Next"

intButton = WshShell.Popup ( "Click a button to proceed." & V & B & V & C & V & C1 & V & C2 & V & C4 ,12 ,  "Test" ,4 + 48)

  select case intButton

''''''''''TIME OUT ACTION

  case -1

TimeOut= WshShell.Popup ( "No Selection Was Made" & V  & "Preparing Defualt Action" , 3, "Time Out Action" , 0 +64 )

  WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48

  Set oWS = WScript.CreateObject("WScript.Shell")

  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"

'    Set oWS = WScript.CreateObject("WScript.Shell")

'  WshShell.Popup "WMP 10",3 , "Sun Java VM 5.0.1",0+48

'    oWS.Run SD & "%sysyemdrive%\WMP10\MP10Setup.exe /q:A /c:"setup_wm.exe /Q /R:N /DisallowSystemRestore"

'    wscript.sleep 100

  WshShell.Popup B1 , 4 , ""& SN , 0 + 64

 

''''''''''TIME OUT ACTION

''''''''''YES ACTION 

  case 6

YesRes = WshShell.Popup ( "Yes Was Selected" & V &  "Preparing Install Of " , 4, "Install APP" , 0 +64 )

  WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48

  Set oWS = WScript.CreateObject("WScript.Shell")

  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"

'    Set oWS = WScript.CreateObject("WScript.Shell")

'  WshShell.Popup "WMP 10",3 , "Sun Java VM 5.0.1",0+48

'    oWS.Run SD & "%sysyemdrive%\WMP10\MP10Setup.exe /q:A /c:"setup_wm.exe /Q /R:N /DisallowSystemRestore"

'    wscript.sleep 100

  WshShell.Popup B1 , 4 , ""& SN , 0 + 64

''''''''''YES ACTION

''''''''''NO ACTION

  case 7

    SN = "No Was Pressed" & V & "Stopping The Install" & V & "Preparing For Next"

  NoRes = WshShell.Popup ( "No Was Selected" & V & B1 , 4, "" & SN , 0 +64 )

''''''''''NO ACTION   

  end select

  Wscript.quit

Link to comment
Share on other sites

ok i removed the popup of radio w/ '

but now oxp_sp3.exe file won't run .. will i need to remove 'SD' infront of oxp_sp3.exe ?

Set WshShell = CreateObject("WScript.Shell")
Z = Chr(95)
Y = Chr(213)
X = Chr(191)
W = Chr(214)
V = Vbcrlf
U = Chr(123)
T = Chr(125)
S = Chr(71)
R = Chr(83)
Q = Chr(77)
Wscript.Sleep 150
On Error Resume Next
Dim Shell, AP, UP, SD, WD, SP , SDI
Set Shell = WScript.CreateObject("WScript.Shell")
AP  = Shell.ExpandEnvironmentStrings("%AllUsersProfile%\")
UP  = Shell.ExpandEnvironmentStrings("%UserProfile%\")
SD  = Shell.ExpandEnvironmentStrings("%SystemDrive%\")
WD  = Shell.ExpandEnvironmentStrings("%windir%\")
SP  = Shell.ExpandEnvironmentStrings("%SystemDrive%\Program Files\")
SDI = Shell.ExpandEnvironmentStrings("%SystemDrive%\Install\")
B  = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Hello And Lets Begin"
B1 = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Good Bye ??"
C = "Would You Like To Install " & V & "Office XP Professional" & V
C1 = "1\YES" & V & space(5) & "Office XP Professional"& V
C2 = "2\NO" & V & space(5) & "Will Not Install Office XP Professional" & V
C4 = "Time Out" & V & space(5) & "If Nothing is Pressed"& V & space(5) &"Then The Defualt Action Is To Install!"& V
SN = "Preparing For Next"
intButton = WshShell.Popup ("Click a button to proceed." & V & B & V & C & V & C1 & V & C2 & V & C4, 12 ,"Test",4 + 48)
 select case intButton
''''''''''TIME OUT ACTION
 case -1
TimeOut= WshShell.Popup ("No Selection Was Made" & V  & "Preparing Defualt Action", 3, "Time Out Action", 0 +64 )
'  WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48
'  Set oWS = WScript.CreateObject("WScript.Shell")
'  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"
 WshShell.Popup "Preparing Office XP Professional",3 , "Office XP Professional",0+48  
   Set oWS = WScript.CreateObject("WScript.Shell")
   oWS.Run SD & "%CDROM%\winapp\oxp_sp3.exe"
   wscript.sleep 100
  WshShell.Popup B1 , 4 ,""& SN , 0 + 64
 
''''''''''TIME OUT ACTION
''''''''''YES ACTION  
 case 6
YesRes = WshShell.Popup ("Yes Was Selected" & V & "Preparing Install Of ", 4, "Install APP", 0 +64 )
'   WshShell.Popup "CLUBNETRADIO.Com",3 , "CLUB NET RADIO",0+48
'  Set oWS = WScript.CreateObject("WScript.Shell")
'  oWS.Run "http://www.clubnetradio.com/listen.php?type=2&bitrate=high wmplayer.exe"
 WshShell.Popup "Preparing Office XP Professional",3 , "Office XP Professional",0+48
   Set oWS = WScript.CreateObject("WScript.Shell")
   oWS.Run SD & "%CDROM%\winapp\oxp_sp3.exe"
   wscript.sleep 100
  WshShell.Popup B1 , 4 ,""& SN , 0 + 64
''''''''''YES ACTION
''''''''''NO ACTION
 case 7
   SN = "No Was Pressed" & V & "Stopping The Install" & V & "Preparing For Next"
 NoRes = WshShell.Popup ("" & SN & V & B1, 4, "No Was Selected" , 0 +64 )
''''''''''NO ACTION    
 end select
 Wscript.quit

tia

Link to comment
Share on other sites

Here The Edited Vbs I Tested This

Dim ts
Dim strDriveLetter
Dim intDriveLetter
Dim fs 'As Scripting.FileSystemObject
Const CDROM = 4
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
strDriveLetter = ""
For intDriveLetter = Asc("A") To Asc("Z")
Err.Clear
If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
If Err.Number = 0 Then
strDriveLetter = Chr(intDriveLetter)
Exit For
End If
End If
Next

Set WshShell = CreateObject("WScript.Shell")
Z = Chr(95)
Y = Chr(213)
X = Chr(191)
W = Chr(214)
V = Vbcrlf
U = Chr(123)
T = Chr(125)
S = Chr(71)
R = Chr(83)
Q = Chr(77)
Wscript.Sleep 150
'On Error Resume Next
Dim Shell, AP, UP, SD, WD, SP , SDI
Set Shell = WScript.CreateObject("WScript.Shell")
CDROM  = Shell.ExpandEnvironmentStrings("strDriveLetter:\")
AP  = Shell.ExpandEnvironmentStrings("%AllUsersProfile%\")
UP  = Shell.ExpandEnvironmentStrings("%UserProfile%\")
SD  = Shell.ExpandEnvironmentStrings("%SystemDrive%\")
WD  = Shell.ExpandEnvironmentStrings("%windir%\")
SP  = Shell.ExpandEnvironmentStrings("%SystemDrive%\Program Files\")
SDI = Shell.ExpandEnvironmentStrings("%SystemDrive%\Install\")
B  = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Hello And Lets Begin"
B1 = Y & X & W & V & U & Z & Z & Z & T & V & S & R & Q & Space(1) & "Says Good Bye ??"
C = "Would You Like To Install " & V & "Office XP Professional" & V
C1 = "1\YES" & V & space(5) & "Office XP Professional"& V
C2 = "2\NO" & V & space(5) & "Will Not Install Office XP Professional" & V
C4 = "Time Out" & V & space(5) & "If Nothing is Pressed"& V & space(5) &"Then The Defualt Action Is To Install!"& V
SN = "Preparing For Next"
intButton = WshShell.Popup ("Click a button to proceed." & V & B & V & C & V & C1 & V & C2 & V & C4, 12 ,"Test",4 + 48)
select case intButton
''''''''''TIME OUT ACTION
case -1
TimeOut= WshShell.Popup ("No Selection Was Made" & V  & "Preparing Defualt Action", 3, "Time Out Action", 0 +64 )
''''''''''WHAT I TESTED AND IT WORKED
WshShell.Popup "Preparing Office XP Professional",3 , "Office XP Professional",0+48  
  Set oWS = WScript.CreateObject("WScript.Shell")
  CD=strDriveLetter
  oWS.Run Run CD & ":\winapp\oxp_sp3.exe"
''''''''''WHAT I TESTED AND IT WORKED
  'oWS.Run CD & ":\SetupApps\MiscApps\TweakUiPowertoySetup.EXE"
  wscript.sleep 100
 WshShell.Popup B1 , 4 ,""& SN , 0 + 64
 
''''''''''TIME OUT ACTION
''''''''''YES ACTION  
case 6
YesRes = WshShell.Popup ("Yes Was Selected" & V & "Preparing Install Of ", 4, "Install APP", 0 +64 )
CD=strDriveLetter
WshShell.Popup "Preparing Office XP Professional",3 , "Office XP Professional",0+48
  Set oWS = WScript.CreateObject("WScript.Shell")
  oWS.Run Run CD & ":\winapp\oxp_sp3.exe"
''''''''''WHAT I TESTED AND IT WORKED
  'oWS.Run CD & ":\SetupApps\MiscApps\TweakUiPowertoySetup.EXE"

  wscript.sleep 100
 WshShell.Popup B1 , 4 ,""& SN , 0 + 64
''''''''''YES ACTION
''''''''''NO ACTION
case 7
  SN = "No Was Pressed" & V & "Stopping The Install" & V & "Preparing For Next"
NoRes = WshShell.Popup ("" & SN & V & B1, 4, "No Was Selected" , 0 +64 )
''''''''''NO ACTION    
end select
Wscript.quit

Edited by gunsmokingman
Link to comment
Share on other sites

there was two 'RUN' at the oxp_sp3.exe line .. but i corrected it

one question. it seems that extraction of oxp_sp3.exe takes process, but before it's able to run .cmd line inside the .exe file , RunonceEX.cmd processes next line.. which is to install sun JAVA.

is there any way to set more time to take in this .vbs file? or any other way for the windows to wait until officexp install is complete?

tia :)

Link to comment
Share on other sites

Are you starting the vbs from a cmd file or the RunOnce Part

Try This 1

echo off

cls && mode 55,4 && color 3f

start /w some.vbs

start /w Another.exe

start /w Whatever.vbs

start /w Examplw.cmd

The above would start and than finish

Try This 2

RED Is The Time It Will Stop In The Script

1000=1 second

It set for 1 minute and 1 second

WshShell.Popup "Preparing Office XP Professional",3 , "Office XP Professional",0+48

  Set oWS = WScript.CreateObject("WScript.Shell")

  oWS.Run CD & ":\winapp\oxp_sp3.exe"

wscript.sleep 61000

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