TheSwamp
Code Red => VB(A) => Topic started by: Hangman on January 17, 2011, 07:23:36 PM
-
Afternoon everyone,
I am writing a script to activate the currently running AutoCAD program on any given machine and then run a LiSP.
I am stuck on how to determine which version is currently running in order to make it active.
If I'm trying to do this:
Set WSO = WScript.CreateObject("WScript.Shell")
...
Function ActivateACAD()
WSO.AppActivate "AutoCAD Map 3D 2011" [color=green]' What if the user is running "AutoCAD Map 3D 2010"[/color]
...
Would I just use an IF statement?
IF NOT WSO.AppActivate "AutoCAD Map 3D 2010" Then
WSO.AppActivate "AutoCAD Map 3D 2011"
End If
Thank you for the help.
-
You could read the registry for the version number, maybe?
-
Or maybe do a find file and read the returned path
-
Try the similar way
'demo.vbs
Dim WSHShell
Dim AcApp
Set WSHShell = WScript.CreateObject("WScript.Shell")
Dim appname
appname="AutoCAD.Application"
Set AcApp = WScript.CreateObject(appname)
AcApp.Visible=True
WSHShell.AppActiVate AcApp.Caption
~'J'~