Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
As explained in "Working with Bitmaps," individual folder attributes can be likened to switches. If the switch for Hidden is on, the folder is a hidden folder. If the switch for Hidden is off, the folder is not a hidden folder.
This analogy can be carried further by noting that light switches are typically under your control: you can choose to turn them on, or you can choose to turn them off. The same thing is true of folder attributes: as with other switches, you can turn these attribute switches on, or you can turn them off.
You can use scripts to toggle these switches on or off (for example, to hide or unhide a folder). The easiest way to change folder attributes is to use the following procedure:
For example, if you want to unhide a folder, check to see whether the folder is hidden.
For example, the script in Listing 4.14 uses the AND operator to check whether the switch with the value 2 (hidden folder) has been set on the folder C:\FSO. If it has, the script then uses the XOR operator to turn the switch off and unhide the folder.
Listing 4.14 Changing Folder Attributes
|
|
Send us your feedback | « Previous | Next » |