Indigo Rose Software
  #1  
Old 12-14-2007
Adam's Avatar
Adam Adam is offline
Indigo Rose Staff Member
 
Join Date: May 2000
Location: Indigo Rose Software
Posts: 2,154
Setting File Attributes For More Than One File

AutoPlay Media Studio has a File.SetAttributes action to set the attributes of a file. If you want to set the attributes of many files at once, you need to perform that action multiple times. An easy way to do this is to store the list of files in a table, and then cycle through that table using a for loop. Each pass through the loop would set the attributes for one of the files.

An easy way to create a table full of file paths is to use the File.Find action. The File.Find action returns a table containing a list of all the files which match a specific pattern.

As an example, let's set all of the .exe files in the root folder of the C: drive to read-only:

1. Insert the following script into an event in your project:

Code:
files_to_change = File.Find("C:\\\\","*.exe");

      -- loop through the files_to_change table
      -- and set each file's attributes one at a time
      for index, filename in files_to_change do
         File.SetAttributes(filename,{ReadOnly=true});
      end
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to share custom buttons with the group? mwreyf1 AutoPlay Media Studio 6.0 10 09-03-2009 05:01 AM
http://yourfilelink.com - 50MB max upload, free! Intrigued General Chat 14 09-26-2006 09:44 AM
Error 3038: Could not seek in compressed file Rikard Setup Factory 7.0 Discussion 2 05-25-2006 12:55 PM
Setting File Attributes For More Than One File Desmond AutoPlay Media Studio 5.0 Examples 0 09-24-2003 02:19 PM
Install only into one of several directories with specific existing file? RichardShaw Setup Factory 5.0 0 08-17-2000 03:29 PM


All times are GMT -6. The time now is 11:55 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software