Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VBS on startup install exe problems

  • 25-01-2011 9:20am
    #1
    Registered Users, Registered Users 2 Posts: 691 ✭✭✭


    Ok so im having problems with this.

    What I want to do is install a Symantec Endpoint on machine run within a OU. the rest i will add in later like if installed etc, but the exe will just not run for me. seeing as its on boot as such the system account should have privilages ok to enable it to run. I have tried to repackage as MSI but even that was a god dam pain.

    Any info will be greatful!


    Running on xp win7 and vista, WMI to only run on these and code in script sorts out the different versions for 64 and 32 bit systems

    
    Option Explicit
    
    Dim strComputer, objWMI, colItems, objItem, objName, InstalledOS, objEmail, objNetwork, objShell
    
    Set objshell = Wscript.CreateObject ("Wscript.Shell")
    
    Const HKEY_LOCAL_MACHINE = &H80000002
    
    
    'On Error Resume Next
    
    Dim WshShell
    Dim strProdList
    Dim OsType
    Dim objWSHShell
    Set WshShell = CreateObject("WScript.Shell")
    Dim ADSysInfo
    
    Set objNetwork = WScript.CreateObject("WScript.Network")
    Set objWSHShell = Wscript.CreateObject("Wscript.Shell")
    Set ADSysInfo = CreateObject("ADSystemInfo")
    
    
    OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
    
    If OsType = "x86" then
    	'wscript.echo "Windows 32bit system detected"
    	
    	
    	
    	Set wshShell = WScript.CreateObject ("WSCript.shell")
    	'wshshell.run "\\package-setup.exe"
    	'set wshshell = nothing
    	InstalledOS = "32Installed"
    
    
    elseif OsType = "AMD64" then
    	'wscript.echo "Windows 64bit system detected"
    
    	objShell.Exec("cmd /c start /wait \\package-setup.exe /passive /quiet /norestart")
    	
    	'Set wshShell = WScript.CreateObject ("WSCript.shell")
    	'wshshell.run "\\package-setup.exe"
    	'set wshshell = nothing
    	InstalledOS = "64Installed"
    
    end if
    
    
    If InstalledOS = "32Installed" then
    
    
    
    			Set objEmail = CreateObject("CDO.Message")
    			objEmail.Configuration.Fields.Item _
        			("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    			objEmail.Configuration.Fields.Item _
        			("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
            			"ex-ip" 
    			objEmail.Configuration.Fields.Item _
        				("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    			objEmail.Configuration.Fields.Update
    			objEmail.From = "email"
    			objEmail.To = "email"
    			objEmail.Subject = "Endpoint Installing 32bit " & objNetwork.ComputerName 
    			objEmail.Textbody = objNetwork.ComputerName & ADSysInfo.UserName
    			
    
    
    '******************************************
    ' Also
    ' Send eMail
    '******************************************
    
    			objEmail.Textbody = objEmail.Textbody & vbCrLf & strProdList		
    			objEmail.Send
    			'wscript.echo "Email Sent 32bit"
    			InstalledOS = "Empty"
    
    Elseif InstalledOS = "64Installed" Then
     
    			Set objEmail = CreateObject("CDO.Message")
    			objEmail.Configuration.Fields.Item _
        			("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    			objEmail.Configuration.Fields.Item _
        			("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
            			"ex-ip" 
    			objEmail.Configuration.Fields.Item _
        				("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    			objEmail.Configuration.Fields.Update
    			objEmail.From = "email"
    			objEmail.To = "email"
    			objEmail.Subject = "Endpoint Installing 64bit " & objNetwork.ComputerName 
    			objEmail.Textbody = objNetwork.ComputerName & ADSysInfo.UserName
    			
    
    
    '******************************************
    ' Also
    ' Send eMail
    '******************************************
    
    			objEmail.Textbody = objEmail.Textbody & vbCrLf & strProdList		
    			objEmail.Send
    			'wscript.echo "Email Sent 64bit"
    			InstalledOS = "Empty"
    
    		
    
    End If 
    
    


Advertisement