Results 1 to 4 of 4

Thread: Changing File Attributes Using Visual Basic 6.0

  1. #1
    Join Date
    Nov 2009
    Posts
    680

    Changing File Attributes Using Visual Basic 6.0

    Hi, I want to change file attributes with the use of the visual basic 6.0. Can anyone has suggestion regarding this. Please give me reply for this. I am using "Programming in VB 6 by Julia case Bradley , Anita C. Millspaugh, TMH" but not getting any solution for this. Can anyone give me better book than this?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Changing File Attributes Using Visual Basic 6.0

    Hi, it is very simple. You need to use SetAttr Function for Modifying File Atrributes. By using the SetAttr Function, We can set the file as read-only or hidden.

    Make the file Read-Only by using :
    SetAttr "c:\vb\attri.txt", vbReadOnly

    Make the file Hidden by using:
    SetAttr "c:\vb\attri.txt", vbHidden

    Make the file Normel by using
    SetAttr "c:\vb\attri.txt", vbNormal

    Ok. I think you got the answer. Now use it.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Changing File Attributes Using Visual Basic 6.0

    Hi, you want to change file attributes then you just need to use the following forms which will give you help in modifying it. You just include it in your code and check it.

    SetAttr "d:\attributechange.txt", vbReadOnly _________ ReadOnly
    SetAttr "d:\attributechange.txt", vbHidden _________ Hidden
    SetAttr "d:\attributechange.txt", vbNormal _________ Back to Normal

    This will work as far as my knowledge.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Changing File Attributes Using Visual Basic 6.0

    Hi, your problem will be solved by using

    SetAttr <filename_with_path>, vbReadOnly to set ReadOnly
    SetAttr <filename_with_path>, vbHidden to set Hidden
    SetAttr <filename_with_path>, vbNormal to set Normal

    You can use reference books such as
    • Visual Basic 6.0 Programming by Content Development Group, TMH
    • The Complete Reference Visual Basic 6 by Noel Jerke , TMH

    to increase your knowledge. Just try to refer this book. The book which you are using is specially developed for the Student of BSC.I.T. So, it has syllabus related to Bsc.I.T. Just use those books for reference.

Similar Threads

  1. Changing folder attributes
    By Deffen-Baugh in forum Vista Help
    Replies: 5
    Last Post: 24-11-2011, 03:45 AM
  2. What is File Handling in Visual Basic 6.0?
    By Dëfrim in forum Software Development
    Replies: 4
    Last Post: 27-12-2010, 05:54 AM
  3. How to create an .exe file in visual basic
    By kasha_i in forum Software Development
    Replies: 3
    Last Post: 21-04-2009, 11:53 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Reading .CSV file in Visual Basic
    By iMacRicky in forum Software Development
    Replies: 4
    Last Post: 15-01-2009, 06:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,642,690,952.36362 seconds with 17 queries