How to add (funtionality of) Environmental Variable %AppData% into VB Script for UNinstalling
Using SCCM for per-machine install. I am using an MSI with transform as my install files that SCCM points to.
I have a package that installs folder structure and files to the User's Roaming folder (AppDataFolder). This is being done by an Active Setup that creates folders/files in the user's Roaming profile upon logging into Windows (post install & reboot).
The install works fine, it is the Uninstall that raises the issue. I have a standard folder/file removal script that works fine with hard coded paths. But hard coded paths are not an option for removing anything from a Roaming profile. How can I add "Appdatafolder" or "%appdata%" equivalent to a VB script so that it applies to anyone performing the uninstall from SCCM?
Here is the standard folder/file script I am using. It is good for deleting hard coded paths as shown:
Set objFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
strComputer = "."
If objFSO.FolderExists("C:\ProgramData\VendorFolderName\SoftwareFolderName") Then
Set objFSO = Nothing
Can I use an Environmental Variable such as %appdata% or equivalent to use in a VB script for Roaming folder?