Hi Sergey,
I took the updated program with the WHS in it to a user to give it a try. However, it crashed in Win XP but run fine in Win 98 (he has removable hard disk drives). Unfortunately, I can't identify the actual line number that it crashed because it is in the menu code, however I suspect that it is the wscript.shell line.
My expectation is that he hasn't got wscript installed in Win Xp which surprises me. Would you consider this a likely scenario also? In that case, would you recommend that I send him the WSCRIPT.EXE file and would it need to be 'registered' to Windows?
I see that my system (Win XP) has wscript.exe installed in c:\windows\system32\
Regards...Rex
>You're welcome.
>There's typo in my code. It should read
CASE lnresult <= 32
> * Some other error
>
because the value less than or equal to 32 represents an error
>
>>Hi Sergey,
>>
>>I will give it a try.
>>
>>Thank you again for all your help.
>>
>>Regards...Rex
>>
>>>Hi Rex,
>>>
>>>You can use FindExecutable Win API to get program associated with PDF files and act accordingly.
DECLARE INTEGER FindExecutable IN Shell32;
>>> STRING lpFile, STRING lpDirectory, STRING @lpResult
>>>
>>>lcfile = ADDBS(SYS(2023)) + SYS(2015) + ".PDF"
>>>STRTOFILE("TEMP FILE", lcfile)
>>>lcbuffer = SPACE(200)
>>>lnresult = FindExecutable(lcfile, "", @lcbuffer)
>>>ERASE (lcfile )
>>>lcExe = ""
>>>DO CASE
>>>CASE lnresult = 31
>>> * No program is associated with PDF files
>>>CASE lnresult < 32
>>> * Some other error
>>>OTHERWISE
>>> * Extract executable associated with PDF file
>>> lcExe = LEFT(lcBuffer, RAT(CHR(0), lcbuffer )-1)
>>>ENDCASE
>>>? lcExe
>>>
>>>>Hi Sergey,
>>>>
>>>>Thank you most sincerely. What you sent me works perfectly!!
>>>>
>>>>In case my user doesn't have Adobe Acrobat Reader on their system, will you please advise me if you know of a way of checking if the reader is loaded onto the users machine?
>>>>
>>>>Regards...Rex
>>>>
Rex Toomey
ISD Port Macquarie NSW
Australia
'Inside every older person is a younger person wondering what happened.'