Hey, The code below works just fine as local administrator. its for an application that has no silent/unattended install switches... when logged in as local administrator it works just fine as said before, but when run as a startup script it errors out, it was too quick to read it and i can not test it from here, but can someone substitue there own short installer and run it as a startup script and see if your thrown an error.
or if its blatant, whats wrong with my code, here it is:
Set oShell = CreateObject("WScript.Shell")
Set oNetwork = CreateObject("WScript.Network")
' ///////////////////////////////////////////////////////////////////////////////////////////////////
' Forcing the script to be run in CScript (This is not my code)
' ///////////////////////////////////////////////////////////////////////////////////////////////////
If InStr(1, WScript.FullName, "CScript", vbTextCompare) = 0 Then
oShell.Run "cscript """ & WScript.ScriptFullName & """", 1, False
WScript.Quit
End If
' ///////////////////////////////////////////////////////////////////////////////////////////////////
' Mapping Source and beginning install from \\triton
' ///////////////////////////////////////////////////////////////////////////////////////////////////
installerOne = "V:\400-501Simulator\SETUP.EXE"
installerTwo = "V:\500-601\SETUP.EXE"
oShell.Run("net use V: \\triton\Apps\Garmin /USER:domain\username password")
WScript.Echo "Mapping the install source..." & vbCrLf & vbCrLf
WScript.Sleep 4000
WScript.Echo "Installing 400-501Simulator... Will continue to next app shortly."
oShell.Run(installerOne)
WScript.Sleep 9000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%Y"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 29000
WScript.Echo "Installing 400-501Simulator... Will wait 25 seconds before proceeding."
oShell.SendKeys "%{F4}"
WScript.Sleep 2000
oShell.SendKeys " "
WScript.Sleep 2000
' 400-501Simulator Installed
WScript.Echo "Installing 500-601Simulator..."
oShell.Run(installerTwo)
WScript.Sleep 9000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%Y"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 29000
WScript.Echo "Installing 500-601Simulator... Will wait 25 seconds before proceeding."
oShell.SendKeys "%{F4}"
WScript.Sleep 2000
oShell.SendKeys " "
WScript.Sleep 2000
I tryed the WSH method of mapping the drive but got the same result. I used a real username and pass of course.
Ideas? I know this is a bad description but my brain is blown, maybe ill come back and clarify.. its also attached.
or if its blatant, whats wrong with my code, here it is:
Set oShell = CreateObject("WScript.Shell")
Set oNetwork = CreateObject("WScript.Network")
' ///////////////////////////////////////////////////////////////////////////////////////////////////
' Forcing the script to be run in CScript (This is not my code)
' ///////////////////////////////////////////////////////////////////////////////////////////////////
If InStr(1, WScript.FullName, "CScript", vbTextCompare) = 0 Then
oShell.Run "cscript """ & WScript.ScriptFullName & """", 1, False
WScript.Quit
End If
' ///////////////////////////////////////////////////////////////////////////////////////////////////
' Mapping Source and beginning install from \\triton
' ///////////////////////////////////////////////////////////////////////////////////////////////////
installerOne = "V:\400-501Simulator\SETUP.EXE"
installerTwo = "V:\500-601\SETUP.EXE"
oShell.Run("net use V: \\triton\Apps\Garmin /USER:domain\username password")
WScript.Echo "Mapping the install source..." & vbCrLf & vbCrLf
WScript.Sleep 4000
WScript.Echo "Installing 400-501Simulator... Will continue to next app shortly."
oShell.Run(installerOne)
WScript.Sleep 9000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%Y"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 29000
WScript.Echo "Installing 400-501Simulator... Will wait 25 seconds before proceeding."
oShell.SendKeys "%{F4}"
WScript.Sleep 2000
oShell.SendKeys " "
WScript.Sleep 2000
' 400-501Simulator Installed
WScript.Echo "Installing 500-601Simulator..."
oShell.Run(installerTwo)
WScript.Sleep 9000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%Y"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 1000
oShell.SendKeys "%N"
WScript.Sleep 29000
WScript.Echo "Installing 500-601Simulator... Will wait 25 seconds before proceeding."
oShell.SendKeys "%{F4}"
WScript.Sleep 2000
oShell.SendKeys " "
WScript.Sleep 2000
I tryed the WSH method of mapping the drive but got the same result. I used a real username and pass of course.
Ideas? I know this is a bad description but my brain is blown, maybe ill come back and clarify.. its also attached.