Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Script wait while software installs

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60084
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script wait while software installs
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Script wait while software installs - 5/11/2008 11:32:46 PM   
  Dicko1976

 

Posts: 43
Score: 0
Joined: 3/5/2008
Status: offline
Hi all

My script is improving all the time thanks to help from this website on bits I get stuck with.

How can I get the script to wait until another application is been installed ?

I get the IT Engineer to click the boxes of the software they want to install and then I want it to go through the script and install the selected applications. I have the following script below which is a simple If statement and it works great on the selection process but it tries to run all the files together.

I dont want to use the sleep method as it doesnt work in HTA and some machines are faster or slower than each other too.

<script language="VBScript">
Set objShell = CreateObject("WScript.Shell")
Sub InstallSoftware

If Winzip.Checked Then
'MsgBox "Winzip is been Installed"
objShell.Run("file:///C:/Program%20Files/Windows%20NT/simnumber.txt")

End If
If MSOffice2000Std.Checked Then
'MsgBox "Office 2000 Std is been Installed"
objShell.Run("
file:///C:/Program%20Files/Windows%20NT/simnumber1.txt")
End If
If LotusNotes.Checked Then
MsgBox "Lotus Notes is been Installed"
End If
If AcrobatReader.Checked Then
MsgBox "Acrobat Reader is been Installed"
End If
End Sub
</script>

Thanks
 
 
Post #: 1
 
 RE: Script wait while software installs - 5/12/2008 12:18:21 AM   
  dm_4ever


Posts: 2433
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you looked at the documentation for the Run method of WSHShell?

http://msdn.microsoft.com/en-us/library/d5fk67ky(VS.85).aspx

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Dicko1976)
 
 
Post #: 2
 
 RE: Script wait while software installs - 5/12/2008 1:16:34 AM   
  Dicko1976

 

Posts: 43
Score: 0
Joined: 3/5/2008
Status: offline
Hi

I have looked at what you asked but could not get any of the commands to work. At least this way I get the files running.

the error I kept getting was CANNOT USE PARENTHESES WHEN CALLING A SUB

Im not too sure what that means.

I tried the script below but it kept comming up with the error.

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

Return = WshShell.Run(file:///C:/Program%20Files/Windows%20NT/Simnumber.txt, 1, true)

All I would like is to for all the software to wait until it is called for......is that possible ?

Thanks

Martyn

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: Script wait while software installs - 5/12/2008 1:29:54 AM   
  dm_4ever


Posts: 2433
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you tried it without the parenthesis like it said....

WshShell.Run command, 1, True

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Dicko1976)
 
 
Post #: 4
 
 RE: Script wait while software installs - 5/12/2008 1:52:56 AM   
  Dicko1976

 

Posts: 43
Score: 0
Joined: 3/5/2008
Status: offline
Hi

I tried it with the parentheses but it was unable to wait for process when the first application opened

Could this be because its a text file im opening when the actual file will be either an MSI file or a exe file ?

Thanks

Martyn

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: Script wait while software installs - 5/12/2008 2:12:28 AM   
  dm_4ever


Posts: 2433
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
Yep, try an exe.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Dicko1976)
 
 
Post #: 6
 
 RE: Script wait while software installs - 7/23/2008 9:30:51 PM   
  Dicko1976

 

Posts: 43
Score: 0
Joined: 3/5/2008
Status: offline
Hi

The line below works great now in a static place but if I put this on to a usb key or cd, how can I get it to look down which ever drive it was on to find the file?

objShell.Run("file:///C:/Program%20Files/Windows%20NT/simnumber.txt")
 
thanks
 
Martyn

(in reply to dm_4ever)
 
 
Post #: 7
 
 RE: Script wait while software installs - 7/23/2008 10:11:14 PM   
  mbouchard


Posts: 1863
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Take a look at the WSH docs, specifically at DriveType.  What you will need to do is look for removable or CD-rom and check for the file on each.  If you have it in a similar location on either device, i.e. in the root, that will be easy.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Dicko1976)
 
 
Post #: 8
 
 RE: Script wait while software installs - 7/23/2008 11:35:59 PM   
  Dicko1976

 

Posts: 43
Score: 0
Joined: 3/5/2008
Status: offline
Hi I tried looking for what I need but it seems to only want to call the actual vbs script that the script is in.

I will be putting this on a usb key, so the drive letter where the files will be pulled in could be different on each machine. Hence why I need the objShell.Run to be able to call the files from what ever drive the usb key is plugged into.

Anybody any ideas ?

Thanks
 
<script language="VBScript">
Set objShell = CreateObject("WScript.Shell")
Sub InstallSoftware
If Winzip.Checked Then
'MsgBox "Winzip is been Installed"
objShell.Run("file:///C:/Program%20Files/Windows%20NT/simnumber.txt")

End If
If MSOffice2000Std.Checked Then
'MsgBox "Office 2000 Std is been Installed"
objShell.Run("file:///C:/Program%20Files/Windows%20NT/simnumber1.txt")
End If
If LotusNotes.Checked Then
MsgBox "Lotus Notes is been Installed"
End If
If AcrobatReader.Checked Then
MsgBox "Acrobat Reader is been Installed"
End If
End Sub
</script>

(in reply to mbouchard)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script wait while software installs Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts