473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to grayed 'Read only' in property of Explorer of Windows with VB?

There was the same question reported in 2005 and was wondering if there was an answer to this question somewhere ...
Dec 5 '07 #1
2 749
kadghar
1,295 Expert 1GB
There was the same question reported in 2005 and was wondering if there was an answer to this question somewhere ...
I dont know if this is good for all versions of VB, but give it a check:

Expand|Select|Wrap|Line Numbers
  1. dim MyFile as io.fileinfo = my.computer.filesystem.getfileinfo("c:\AnyFile.xls")
  2. myfile.isreadonly = true
HTH
Dec 5 '07 #2
I dont know if this is good for all versions of VB, but give it a check:

Expand|Select|Wrap|Line Numbers
  1. dim MyFile as io.fileinfo = my.computer.filesystem.getfileinfo("c:\AnyFile.xls")
  2. myfile.isreadonly = true
HTH
Thanks a lot. That is not really working for me BUT while I was trying it, it lead me to the solution. I used:
Expand|Select|Wrap|Line Numbers
  1. ActiveDocument.ReadOnlyRecommended = True
ant it seems to work. I can still change the Windows Property, but it looks like the read-only permissions is set internaly and it doesn't get affected even when I change the permission from Windows explorer.

Thanks

GLP
Dec 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Raymond H. | last post by:
Hello, I'd like to be able to desabled the 'Read only' (and grayed this case) with vb codes. How to do this to protect a file againts deleting? r.h.
4
by: Ed | last post by:
Hello All, I posted earlier about a problem I was having with editing or pasting/deleting files in the "Home Directory" of my web server. I just noticed that the "Home Directory" option in the...
0
by: Mark Molinari | last post by:
Hello, I have a Windows 2003 Enterprise server, acting as the primary domain controller, with 2 instances of SQL Server 2000, Active Directory, and Exchange 2003 running on it. Both sql server...
7
by: JerryW | last post by:
I just reinstalled .NET 2003 (after repeated attempts to get ASP.NET Web Applications to work). I first did a complete uninstall of .NET 2003, .NET Framework 1.1, and IIS. I also completely deleted...
9
by: John Howard | last post by:
How can I read a text file that is on a UNIX server in VB.Net? Please keep it simple. Thanks, John
17
by: rdemyan via AccessMonster.com | last post by:
I have a launcher program that creates the shortcut to open my application using the Shell command. On the form I have a decompile checkbox that I can conveniently use to decompile my program. I...
4
by: Jim | last post by:
I have the following piece of code: Directory.CreateDirectory(myDir); DirectoryInfo lDir = new DirectoryInfo(myDir); lDir.Attributes = FileAttributes.Normal; When this code runs, my directory...
1
by: nospam | last post by:
Hello all, Using Net 2 0 and VS 2005 and MSSQL 2000... I am a newbie to ASP. I am trying to created a screen to manipulate a table - CRUD commands. The problem is the checkbox to...
2
by: LillianH via AccessMonster.com | last post by:
Suddenly all of my database have the delete option grayed out when I open them. HOW do I change this. It appears the database is read only. I cannot delete tables, modify queries , etc. I...
23
by: Dan Tallent | last post by:
A textbox has a attribute for ReadOnly. This seems like such a simple concept. When a textbox is set to read only the user cannot change the contents of the field. I have been trying to find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.