How to properly use fso.GetAbsolutePathName in VBScript
For the love of god, will someone please explain to me why I can't simply use the fso.GetAbsolutePathName function within Vbscript to get the directory path of where the script is running from. I've searched all over on how to do this, but I can't seem to find anything that would be helpful in my case.
Here is how my script looks at the moment.
Dim fso, WshShell
const EVENTLOG_INFORMATION = 4
const HKEY_LOCAL_MACHINE = &H80000002
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = WScript.CreateObject("Scripting.Filesystemobject")
DIR = fso.GetAbsolutePathName (".")
wshshell.Exec "msiexec.exe /i product1.msi TRANSFORMS=product1.mst PATCH=DIR\product1.MSP"
When I executabe the script, I end up with error 1635. If I execute the script with the below code, then it runs just fine.
wshshell.Exec "msiexec.exe /i product1.msi TRANSFORMS=product1.mst PATCH=C:\test\product1.MSP
Does anyone know why I can't use the DIR variable I am setting within my path for the PATCH file?
Thanks for any input you guys can provide