Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 17-11-2009
Member
 
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?
Reply With Quote
  #2  
Old 17-11-2009
Member
 
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.
Reply With Quote
  #3  
Old 17-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
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.
Reply With Quote
  #4  
Old 17-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 07:38 PM.