+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 43
O/S Deployment Thread, Anyone write me a VB Script please? in Technical; Originally Posted by mbrunt hmm thanks but same error. Is it on the same line and character? You will have ...
  1. #16
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    Quote Originally Posted by mbrunt View Post
    hmm thanks but same error.
    Is it on the same line and character? You will have to do the same to the sophos lines

  2. #17
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    Actually scratch that try

    Code:
    WshShell.Run "msiexec.exe /qn /i ""t:\APPS\AB\v6\silent\abtclient6.msi"""
    


    Too many ""s lol

  3. #18

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    ive stripped the script down to this for now...


    dim objNetwork
    Set objNetwork = CreateObject("Wscript.Network")
    objNetwork.MapNetworkDrive "T:", "\\ccmgmt01\its", False, "carmel.local\administrator", "password"

    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run "msiexec.exe /qn /i """t:\APPS\AB\v6\silent\abtclient6.msi""""

    objNetwork.RemoveNetworkDrive "T:"


    now error is line 6, char 37, expected end of statement...
    Last edited by mbrunt; 16th July 2012 at 03:56 PM.

  4. #19

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    when i run this...

    dim objNetwork
    Set objNetwork = CreateObject("Wscript.Network")
    objNetwork.MapNetworkDrive "T:", "\\ccmgmt01\its", False, "carmel.local\administrator", "password"

    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run "msiexec.exe /qn /i ""t:\APPS\AB\v6\silent\abtclient6.msi"""

    objNetwork.RemoveNetworkDrive "T:"

    i get no error but nothin happens at all :S

  5. #20
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    Are you sure it hasn't run the installer? It is running in silent mode so you wouldn't see anything.

    Check in event vwr for Windows Installer entries

  6. #21

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    yeah i dont even see it map the network drive :S

  7. #22

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    ok, it looks as if the drive is being mapped n then deleted before sophos can even have time to install

  8. #23

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    10,053
    Thank Post
    3,585
    Thanked 1,123 Times in 1,025 Posts
    Rep Power
    377
    I think I know what it is

    You map network drive T
    you execute an installer from the T Drive
    You are trying to remove or un map the T drive whilst it is still in use , no pause or anything for said installer to finish before trying to remove the T Drive
    @mbrunt beat me to it lol

    Can you move the line of code to nearer the bottom of the script so it un maps the T drive once it has completed the other tasks ?

    Haven't got time to look into this so @Steve21 or someone else can post a bit of vbscript that will make it wait until the installer has completed before executing the code to remove the network drives?
    Last edited by mac_shinobi; 16th July 2012 at 04:01 PM.

  9. #24

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    mac yea ur right, if i tell it not to unmap it works ok...

  10. #25
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    lol you should be able to run the installers without mapping the network drive? Just put the full UNC path as the arguments to msiexec

  11. #26

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    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!

  12. #27

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    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

  13. #28
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    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

  14. #29

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    306
    Thank Post
    17
    Thanked 10 Times in 10 Posts
    Rep Power
    15
    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

  15. #30
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    62
    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



SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. vb script help please
    By mac_shinobi in forum Scripts
    Replies: 13
    Last Post: 31st March 2011, 01:39 PM
  2. Replies: 0
    Last Post: 22nd November 2009, 12:07 PM
  3. Replies: 5
    Last Post: 14th November 2009, 05:37 PM
  4. Writing to Excel from .vbs script
    By Samson in forum Windows
    Replies: 6
    Last Post: 15th October 2008, 08:34 AM
  5. VBS script for prestaging computers anyone?
    By ChrisH in forum Scripts
    Replies: 7
    Last Post: 23rd June 2006, 10:59 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •