mbrunt Posted July 16, 2012 Author Posted July 16, 2012 ha, how do i get it to wait then? my normal command script did that.......scratch that, ok jamo ill try that. there was a reason i cudnt use uncs in the past, but i forget what that was!
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 i shud jus put these apps in the fricking task sequence ;P would have been easier to learn how to do that then mess with vb haha ive started now tho....will get back to you in 5
Jamo Posted July 16, 2012 Posted July 16, 2012 I use a single MDT app which is an 'app bundle' and map all the individual applications as dependencies for the big bundle app. Means you don't have to keep editing the task sequences to add new applications
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 jamo - i cant do what you suggested as the user im logged in with doesnt have any permission to the unc path, hence the mapped network drive with credentials....thats why i mapped a drive :S
Jamo Posted July 16, 2012 Posted July 16, 2012 Probably the easiest thing to do here is to use MDT and let it run the application as a different user. Its an option in the application settings If you chose Application with no source files or source files elsewhere on the network as the application options it will be quick to set up hehe
mac_shinobi Posted July 16, 2012 Posted July 16, 2012 (edited) look here : VBScript - Problem with wsh.shell not waiting for command to finish executing Use Exec Instead of Run '----------------------------------------------------------------------- ' execute commandline and get result into strResult '----------------------------------------------------------------------- Set oWsc = CreateObject("WScript.Shell") Set oExec = oWsc.Exec(("Exchange2003\SETUP\I386\SETUP.EXE /unattendfile unattend.ini") ' wait until finished Do While oExec.Status <> 1 WScript.Sleep 100 Loop '-------------------------------------------------------- ' get output from StdOut and StdErr '-------------------------------------------------------- strResult = oExec.StdOut.ReadAll() & oExec.StdErr.ReadAll() Set oExec = Nothing The last chunk is error checking / placing any errors into the variable strResult so you should be able to put your other code just after the Loop ( might want a sleep or pause for a few seconds though ?? So I presume it would be something along the lines of ' Your code to map the T Drive etc here Set WshShell = WScript.CreateObject("WScript.Shell") Set oExec = WshShell.Exec(("Exchange2003\SETUP\I386\SETUP.EXE /unattendfile unattend.ini") ' wait until finished Do While oExec.Status <> 1 WScript.Sleep 100 Loop objNetwork.RemoveNetworkDrive "T:", True, True '-------------------------------------------------------- ' error checking which you can delete or leave - get output from StdOut and StdErr '-------------------------------------------------------- strResult = oExec.StdOut.ReadAll() & oExec.StdErr.ReadAll() Set oExec = Nothing ' The Remainder of your code If you are doing the same to launch and install other apps and then remove the network drive / path then you may want to repeat a similar chunk of code to make it wait for the app to finish installing. Also you don't want to replicate the shell objects etc so you can safely use your one and adjust the code to suit, also you will need to adjust the path for the installer in my code above In your code you have : Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "msiexec.exe /qn /i """t:\APPS\AB\v6\silent\abtclient6.msi"""" Where as in the example I posted they have used Set oWsc = CreateObject("WScript.Shell") Set oExec = oWsc.Exec(("Exchange2003\SETUP\I386\SETUP.EXE /unattendfile unattend.ini") ' wait until finished Do While oExec.Status <> 1 WScript.Sleep 100 Loop They are trying to do something for Exchange as per the path : "Exchange2003\SETUP\I386\SETUP.EXE /unattendfile unattend.ini where as one of your paths is : t:\APPS\AB\v6\silent\abtclient6.msi Edited July 16, 2012 by mac_shinobi
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 Wow, im confused now! I dont know what my best bet is, to install the two apps using MDT or to try to get the vbscript to work properly, or to just leave it as it is ......... If I do the MDT app deploy route what do I put in the command line and working directory boxes?
januttall Posted July 16, 2012 Posted July 16, 2012 (edited) youd be better just sticking with the bat file for the above and i don't know why your mapping t to then disconnect? you can access shares via bat files getting rid of the two lines. having it in a vbs just makes it hard to modify and ten times more dificult to create. yea vbs is grate for things like pauses or complicated steps but for the sake of the above stick with a bat. you could put a check in make shure it hasent allready been run and if it has exit. then deploy it via a GPO, thats how we do it. Edited July 16, 2012 by januttall
Jamo Posted July 16, 2012 Posted July 16, 2012 Lol options! My bet (but thats cus its the one I know, my VBScript isn't the best) is on using MDT as you will get better error explanations and will get a better view of where you are in the task sequences with a progress bar As I mentioned earlier a single bundle app attached to a task sequence and all the other apps as single dependencies to the bundle is the easiest way of achieving easy maintenance of the task sequences.
mac_shinobi Posted July 16, 2012 Posted July 16, 2012 (edited) Not done MDT before so will have to leave that for someone else to advise you on, If you want to continue on the vbs path, either myself, @Steve21 or the likes can try and assist with that. Entirely up to you MDT option sounds easier ( assuming it is easy enough to setup and get working ) as clearly makes admin and seeing errors etc a lot easier from what @Jamo is saying above Edited July 16, 2012 by mac_shinobi
Jamo Posted July 16, 2012 Posted July 16, 2012 In the command line you just put the msiexec /i "pathtomsi.msi" /qn command I usually leave the working directory blank and it just uses the current dir. You can then chose the connect using credentials to your admin user with the ability to connect to the share 1
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 ah right ok, i think ill try mdt tomorrow (already have a room imaging at the min so dont wanna mess) if that fails ill just stick with my good old vbs that literally calls my batch file lol. i'll return with more info! thanks for your help so far everyone. 1
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 where abouts can i put credentials, cant see anything in the application or task sequence.
Jamo Posted July 16, 2012 Posted July 16, 2012 Good question.... I'm at home today!! By default MDT will connect with the local machines administrator account. I think when you select the bundle application within the task sequence you can get MDT to change the account for that taask sequence step. (So its in the task sequence rather than the individual app)
mbrunt Posted July 16, 2012 Author Posted July 16, 2012 Sorry I dont really see what you mean by bundle application, my only options in the install applications part of the task sequence are "install multiple applications" or "install a single application" but theres no box for alternative credentials etc...
Jamo Posted July 16, 2012 Posted July 16, 2012 I might need to check when I look tomorrow. You can use run command line if you just want to run the msiexec command and that definitely has a run as command. I will have to double check my application installs as they are all from a share which has read only to 'Authenticated Users' meaning that anyone can read + execute the apps.
Jamo Posted July 16, 2012 Posted July 16, 2012 Just for reference, install multiple applications installs the 'required' applications for that machine type, which usually only come around when you have the database integrated with MDT. Install Single Application is what you would want, is there anything in the second tab? I may be going mad here, sitting at home with a cold so not thinking very well at all lol
Jamo Posted July 17, 2012 Posted July 17, 2012 Right... Had a look last night and you have a couple of options: Use the Run Command Line task in a task sequence for each of the stages of your VBS script. (This will allow you to run as a different user, its a section in the task sequence editor not the application editor sorry my bad!) Allow Authenticated Users/Everyone as read only to your shares with installers on, and use an MDT application to install just passing the full unc path to the MSI. And hidden option C: Split the batch files up and install them as single MDT applications, this gives you a better chance of catching errors whilst still allowing you to use batch files to install I personally can't stand VB Script for simple installs, the syntax is awful for just calling command lines. Hope that helps somewhat!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now