quote:Originally posted by Toneo
This code checks if the folder WINDOWS exists in the C:\WINDOWS\ Directory...
The code checks if the folder WINDOWS exists in the C:\ directory/folder/map/whatever.
quote:Originally posted by Toneo
If you try it and it says "false" then something must be wrong because Windows requires the WINDOWS folder to function.
Actually, the name can be anything. It is not always "Windows" (eg: "WinNT", "Win", "WinXP", etc). So, if it returned false, it only means the user has another name for his main Windows folder.
quote:Originally posted by Toneo
Both FolderExists() and FileExists() are both VERY useful in scripts, you can use them to detect whether a file already exists.
Although true, they also have bugs. They will not always return the proper boolean. Be very carefull when you use those functions to check for empty directories, files with the same name as a directory, nul-files, etc.... Somewhere on the forums here there is a more detailed post about it. You're better of using the Windows APIs directly (though, this goes beyond the extent of your otherwise excellent tutorial).
PS: also add a link to the JScript documentation where all this is also explained with examples for each function.
This post was edited on 12-01-2007 at 12:32 AM by CookieRevised.