@Steve21 - may be able to help with the vbs side, might be others who may be able to suggest something else ?
See my batch file below, could someone possibly kindly rewrite this in a vbs for me?
net use t: \\ccmgmt01\its /User:domain.local\administrator P&ssword
msiexec /qn /i "t:\APPS\AB\v6\silent\abtclient6.msi"
net use t: /delete /y
@echo Checking to see if Aero capable...
@echo Switching off Hibernate...
powercfg -h off
@echo Installing Sophos Antivirus, please wait...
net use s: \\ccsophos01.domain.local\sophosupdate /User:domain.local\sophos P&ssword
setup.exe -updp "\\ccsophos01\SophosUpdate\CIDs\S000\SAVSCFXP" -user "domain.local\sophos" -pwd "P&ssword" -mng yes
net use s: /delete /y
del /f "c:\windows\system32\sysprep\x64unattend.xml"
The reason I need it rewriting is that although the script works perfectly mdt seems to find something wrong with it and causes the task sequence to report errors at the very end. What I've done for now is write a very basic vbs that simply calls the batch file above. Although this works its not 100% ideal.
Thanks for anyone that can help!!
any help would be appreciated thanks, vbscript it not my strong point! lol. i will return the favour, somehow
If you have written a VBS script to call that batch script then that command is probably going to be the same one to call all those separate commands in your batch file. Just keep repeating it for all the commands.
because i have no idea of how to map and delete network drives, or how to get the script to delete itself,...
Can't really test this due to your paths etc, but this should work unless I missed some syntax changes from your exes etc, but try this when you have a minute
SteveCode:dim objNetwork Set objNetwork = CreateObject("Wscript.Network") objNetwork.MapNetworkDrive "T:", "\\ccmgmt01\its", False, "domain.local\administrator", "P&ssword" Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "msiexec.exe /qn /i "t:\APPS\AB\v6\silent\abtclient6.msi"" objNetwork.RemoveNetworkDrive "T:" WshShell.Run "winsat.exe dwmformal" WshShell.Run "powercfg -h off" objNetwork.MapNetworkDrive "S:", "\\ccsophos01.domain.local\sophosupdate", False, "domain.local\sophos", "P&ssword" WshShell.Run "S:\CIDs\S000\SAVSCFXP\setup.exe -updp "\\ccsophos01\SophosUpdate\CIDs\S000\SAVSCFXP" -user "domain.local\sophos" -pwd "P&ssword" -mng yes" objNetwork.RemoveNetworkDrive "S:" Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile "c:\windows\system32\sysprep\x64unattend.xml", True fso.DeleteFile WScript.ScriptFullName
mac_shinobi (14th July 2012)
Thanks for the script However, line 6 character 35, expected end of statement :s ? Thanks
Nah tried that, same error.
Just out of curiosity, why aren't you using MDT to map the drives etc for installing the apps? You should be able to get a decent error code out of it then.
Something else to note is that the error codes from MDT are decimal whereas most sites will list them as hex ie 0x8007002 etc.
Also if you want to map drives in batch files its more friendly these days to use pushd and popd which will auto add/remove drives from network locations without causing errors which are usually just, "someone is using this dir and you have force disconnected it" etc etc.
The same goes for the Sophos install. I have all mine separated though into their different MDT applications, makes management a little easier.Code:pushd \\ccmgmt01\its msiexec /qn /i ".\abtclient6.msi" popd
I've never heard of pushd or popd but I shall give it a go. Also, I'm running the script at the end of the task just because its easy to be honest. I haven't yet looked into MDT deploying apps, but I shall probably also give that a go sometime soon.
For now though I just want this vb to work properly, im currently calling a batch file from a vb, which works but its a bit dirty.
That error btw on line 6 is due to the double " chars
WshShell.Run "msiexec.exe /qn /i "t:\APPS\AB\v6\silent\abtclient6.msi""
The bold lettering is where the .Run command will go to due to the " effectively escaping the command early.
Try altering the line to:
WshShell.Run "msiexec.exe /qn /i """t:\APPS\AB\v6\silent\abtclient6.msi""""
hmm thanks but same error.
There are currently 1 users browsing this thread. (0 members and 1 guests)