PDA

View Full Version : File.DoesExist ?????



octane6228
02-04-2004, 03:51 PM
Hi ...I'm trying to search for a file (divx.dll)in "C:\Windows\system32\" but can't seem to get it to work....I can get it to find a file (divx.dll) if the file resides in the windows directory only......as the code below shows....
----------------------------------------------------------------------------


-- Checks to see if a particular file exists.
Answer = File.DoesExist (_WindowsFolder.."\\dixv.dll");

-- If the file does not exist, display a message notifying the user.
if Answer == false then
result = Dialog.Message("Notice", "The specified file does not exist.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

else
result = Dialog.Message("Notice", "The specified file EXISTS.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end

----------------------------------------------------------------------------

I've tried changing the "_WindowsFolder" to a full path (eg. C:\windows\system32) but it doesn't return the correct answer, just says "The specified file does not exist."

How do I get it to search the C:\windows\system32 directory for the divx.dll file ? My non-working code for this is below.....

----------------------------------------------------------------------------


-- Checks to see if a particular file exists.
Answer = File.DoesExist (C:\WINDOWS\system32 ,"\\dixv.dll");

-- If the file does not exist, display a message notifying the user.
if Answer == false then
result = Dialog.Message("Notice", "The specified file does not exist.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

else
result = Dialog.Message("Notice", "The specified file EXISTS.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end

----------------------------------------------------------------------------

Thanks for your help.

Ted Sullivan
02-04-2004, 05:44 PM
Try using the global variable "_SystemFolder" rather than "_WindowsFolder"

From the Command Reference: Variables/Global Variables
http://www.indigorose.com/webhelp/ams50/Program_Reference/Variables/Global_Variables.htm

_SystemFolder
The path to the userís Windows System folder (e.g. "C:\Windows\System").