Question:
Is there any method that retrieves the path of the folder where the application domain is?
Solution:
To retrieve the path of the folder with the application, you can use VBScript’s CurrentDirectory property.
In the sample script below, it is executed in an internal tag, which loads the current path of the domain to Path tag:
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
Parent.Item("Path").Value = WshShell.CurrentDirectory
Path tag’s Value property contains the path to the domain’s folder.
NOTE: Because of the restrictions of the Shell object in a server script, the domain path can be obtained through the following script:
Sub Dados_OnStartRunning()
Set fso = CreateObject ("Scripting.FileSystemObject")
Item("Path").Value = fso.GetAbsolutePathName("Domain.dom")
End Sub