Wednesday, October 12, 2005

VBscript to deploy AutoCAD 2006 SP1 or the like

Here is a snippet of a VBScript that I used to install AutoCAD 2006 SP1:
on error resume next
Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Acad2006="HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R16.2\ACAD-4001:409\"
PN=""
PN = WshShell.RegRead(Acad2006 & "ProductName")
If fso.FolderExists("C:\Program Files\AutoCAD 2006") and PN="AutoCAD 2006" Then
  Release=""
  Release = WshShell.RegRead(Acad2006 & "Release")
  If Release="16.2.54.10" Then
    WshShell.Run """\\it.local\Acad2006\AutoCAD2006SP1.exe"" /q",1,true
  End if
End if

1 comment:

  1. Restored comment

    R.K. McSwain said...

    Nice. I've got to get more educated on scripting. I'm still using BAT files. :-)

    Some may want to consider backing up and restoring "acmap.cui" and "land.cui" (in the case of LDT2006) in case your users have modified these files (with their own workspaces).

    Ok, I didn't bring that up to debate the whole menu/CUI administrative issue, I'm just saying that it's possible that someone out there has users with modified CUI files.

    Thanks for your example.
    October 12, 2005

    ReplyDelete