A Sample Installation Script
 
 
 

The sample script in this section installs the program in a typical configuration. To make it easy to copy this sample script and substitute your own information, the same names are used throughout for variable items. The log file name is based on the product being installed. You can either use the log file name in the script or change it to something else.

Serial number prefix: 123

Serial number: 12345678

First name: My First Name

Last name: My Last Name

Organization: Organization

A sample script for a silent installation of this program uses the syntax shown in this section.

Scripted installation for the AutoCAD

' Scripted installation for AutoCAD 2011 - English
option explicit
' 
' Create variables 
dim shell
dim productType
dim strADSKFirstName
dim strADSKLastName
dim strADSKOrganization
dim strADSKSNPrefix
dim strADSKSNNumber
dim strADSKProdKey
dim strLocale
dim strACADStandaloneNetworkType
dim strADSKLicenseServerType
dim strADSKLicenseType
dim strADSKServerName
dim strADSKServerPath
dim strADSKServerHostID
dim strADSKPath
dim strSourcePath
' 
' Script initialization
Set shell = CreateObject("WScript.Shell")
productType = "ACAD"
'
' Name and Organization information 
strADSKFirstName = "My First Name" 
strADSKLastName = "My Last Name" 
strADSKOrganization = "Organization" 
' 
' Serial Number information 
strADSKSNPrefix = "123" 
strADSKSNNumber = "12345678" 
strADSKProdKey="ABCDE"
'Locale information, for example en-US = US English, de-DE = Deutchland German, ja-JP = Japan Japanese
strLocale="" ' en-US, de-DE, ja-JP
'
' Source to install from (e.g. D: is assumed to be Install Media) 
strSourcePath = "D:\"
'
' Destination to install to 
strADSKPath = Shell.ExpandEnvironmentStrings("%ProgramFiles%")  + “\Autodesk\” + "AutoCAD 2011" 
If strLocale <> "" Then strADSKPath = strADSKPath + " " + strLocale
strADSKPath = strADSKPath + "\"
'''''' Uncomment the relevant version of your installation - Default is Standalone 
' For Standalone 
RunStandaloneInstall() 
' 
' For Single Network License Server
'RunSingleLicenseServerInstall() 
'
' End of Script
Wscript.quit() 
' 
Function RunStandaloneInstall 
  shell.run DefaultCommand(),2,1 
end function 
' 
Function RunSingleLicenseServerInstall 
' Update with the correct information for the license server
 strACADStandaloneNetworkType = "3" 
 strADSKLicenseServerType = "Single Server License" 
 strADSKLicenseType = "Network License" 
 strADSKServerPath = "myFlexNetServer" 
' HOSTID or MAC address
 strADSKServerHOSTID = "000000000000"
'
' Consolidate the two values 
 strADSKServerPath = strADSKServerPath & " " & strADSKServerHOSTID
 shell.run MakeCommand(),2,1 
end function 
' 
Function DefaultCommand 
 dim retString 
' /qb for silent install ' /c [key] override parameters for the key 
' /w wait until installation completes before returning to script
' /o reboot after install completes
retString = """" & strSourcePath & "\setup.exe" & """" & " /t /qb " 
If strLocale <> "" then
        retString = retString & "/Language " & strLocale 
End if
retString = retString & " /c " & productType & ": " 
retString = retString & "INSTALLDIR=" & """" & strADSKPath & """" & " " 
retString = retString & "ACADSERIALPREFIX=" & strADSKSNPrefix & " " 
retString = retString & "ACADSERIALNUMBER=" & strADSKSNNumber & " " 
retString = retString & "ADLM_PRODKEY=" & strADSKProdKey & " " 
retString = retString & "ACADFIRSTNAME=" & """" & strADSKFirstName & """" & " "
retString = retString & "ACADLASTNAME=" & """" & strADSKLastName & """" & " "
retString = retString & "ACADORGANIZATION=" & """" & strADSKOrganization & """" & " " 
retString = retString & "InstallLevel=5 " 
DefaultCommand = retString & " " 
end function 
' 
Function MakeCommand 
dim retString 
retString = DefaultCommand() & " " 
retString = retString & "ACADSTANDALONENETWORKTYPE=" & """" & strACADStandaloneNetworkType & """" & " " 
retString = retString & "ACADLICENSESERVERTYPE=" & """" & strADSKLicenseServerType & """" & " " 
retString = retString & "ACADLICENSETYPE=" & """" & strADSKLicenseType & """" & " " 
retString = retString & "ACADSERVERPATH=" & """" & strADSKServerPath & """" & " " 
MakeCommand = retString 
end function