I am trying to retrieve file details from files in the Program Files folder.
I receive an error while trying to retrieve file details.
Dim sFileName As String = ("%ProgramFiles%\Windows Defender\MSASCui.exe")
Dim Info As FileVersionInfo
Info = FileVersionInfo.GetVersionInfo(sFileName)
Msgbox(Info.ProductName.ToString())
I receive file not found error at 3rd line.
But if I change the path from "%ProgramFiles%\Windows Defender\MSASCui.exe"
to "c:\Program Files\Windows Defender\MSASCui.exe"
it works fine.
What should I do if I want to retrieve file details from the path which includes a "%" character?