View Full Version : File.Open Not Finding File when path pulled from Registry

02-10-2004, 06:42 PM
Having a bit of trouble finishing a function that, after it verifies the path of a document, uses

pdfInstallPath = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\MyApp\\27", "InstallPath", true);

File.Open(pdfInstallPath.."sample.pdf", "", SW_SHOWNORMAL);

*pdfInstallPath returns the correct pathing information, without the trailing backslash.

This code returns "The Specified File could not be found" (after being run through:
--Check to see if an error occurred.
error = Application.GetLastError();

-- If an error occurred, display the error message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);

I have tried appending the backslash \ using .. and \\, but have not had any luck. If you could tell me where I'm going wrong, it would be appreciated.

Thanks again for your time and help
- Thomas

02-11-2004, 12:01 AM
Have you tried this:

File.Open(pdfInstallPath.."\\sample.pdf", "", SW_SHOWNORMAL);

02-11-2004, 12:00 PM
That works perfectly Lorne, thanks again for the help!