vb script help needed to detect error
Hi have a script which looks like it. But some how it does nt take silent switches. Can anybody help me figure out?
Thanks
'======= Install Script =========================================================================================
'=================================================================================================================
DEPLOYNAME = "visual studio 2012 premium"
On Error Resume Next
Set sh = CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
quote = chr(34)
SCRIPTDIR = fs.GetAbsolutePathName(".")
LOGFILE = sh.expandenvironmentstrings("%TEMP%\visual studio 2012 premium All -I.log")
BUILDLOG = LOGFILE & "\" & DEPLOYNAME
'======= App Install Section =========================================================================================
'=================================================================================================================
MYFILE = SCRIPTDIR & "\dotNetFx45_Full_x86_x64.exe"
If fs.fileexists(MYFILE) Then
CMDLINE ="/q /norestart=" & quote
lret = sh.run(quote & MYFILE & quote & CMDLINE,1,True)
End If
'=======Visual studio Install Section =========================================================================================
'=================================================================================================================
MYFILE1 = SCRIPTDIR & "\vs_premium.exe"
If fs.fileexists(MYFILE1) Then
CMDLINE ="/passive /norestart /full /noweb=" & quote
lret = sh.run(quote & MYFILE1 & quote & CMDLINE,1,True)
End If
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
dedenker
10 years ago
Posted by:
anonymous_9363
10 years ago
I think you either have a rogue 'quote' reference or some text missing after the "noweb=" part. I would've posted the corrected line but this idiot text-box doesn't allow pasting!!
It would be much easier to see if you took the trouble to reformat the text. Let's leave aside the issue that this forum *still* doesn't have the ability - except here in the 'Answer' section - to tag text as code.
MYFILE1 = SCRIPTDIR & "\vs_premium.exe" If fs.fileexists(MYFILE1) Then CMDLINE ="/passive /norestart /full /noweb=" & quote lret = sh.run(quote & MYFILE1 & quote & CMDLINE,1,True) End If - See more at: http://www.itninja.com/question/vb-script-help-needed-to-detect-error#sthash.CCzcuHko.dpuf
MYFILE1 = SCRIPTDIR & "\vs_premium.exe" If fs.fileexists(MYFILE1) Then CMDLINE ="/passive /norestart /full /noweb=" & quote lret = sh.run(quote & MYFILE1 & quote & CMDLINE,1,True) End If - See more at: http://www.itninja.com/question/vb-script-help-needed-to-detect-error#sthash.CCzcuHko.dpuf
MYFILE1 = SCRIPTDIR & "\vs_premium.exe" If fs.fileexists(MYFILE1) Then CMDLINE ="/passive /norestart /full /noweb=" & quote lret = sh.run(quote & MYFILE1 & quote & CMDLINE,1,True) End If - See more at: http://www.itninja.com/question/vb-script-help-needed-to-detect-error#sthash.CCzcuHko.dpuf
Posted by:
AngelD
10 years ago