user0one Posted August 27, 2005 Posted August 27, 2005 How do I remove the read only attributes to my D Partition. Some Apps I have installedwon't save a new file to read only folders. I keep all these folders on the D partition.
gunsmokingman Posted August 27, 2005 Posted August 27, 2005 (edited) This will change all Read only properties on the drive selected.This should help you.This is a hta with VBS scriptSave As ChangeAttrib.Hta<HTML><HEAD><TITLE> Gsm Change Attributes </TITLE> <HTA:APPLICATION ID="GsmSearchV1" SYSMENU="yes" SCROLL="No" SCROLLFLAT ="No" SingleInstance="Yes" ShowInTaskbar="Yes" MaximizeButton="No" MinimizeButton="NO" BORDERSTYLE ="complex" INNERBORDER ="No" Border="Thin" Caption="Yes" WindowState="Normal" APPLICATIONNAME="GsmV1_SearchFile" Icon="http://www3.telus.net/GSMJAK1E/AUABuilder/BgImgs/Hta2.ico"> <html xmlns:v="urn:schemas-microsoft-com:vml"xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word"xmlns="http://www.w3.org/TR/REC-html40"> <!--[if !mso]><style>v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}</style><![endif]--><!-- [if gte mso 9]><xml><o:DocumentProperties></w:LatentStyles></xml><![endif]--> <style></style><!--[if gte mso 10]><style></style><![endif]--> <script language="vbscript"> Dim Act : Set Act = CreateObject("Wscript.shell") Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim UName : UName = Act.ExpandEnvironmentStrings("%UserName%") Dim strComputer,SDrv strComputer = "." window.resizeTo 375,225 Function RstF '''' <!-- ;;;;; SCRIPT THIS IS THE AMOUNT OF TIME IT STOPS 1000 = 1 SECOND ;;;;; --> Dim Ts : Set Ts = Fso.OpenTextFile(SD & "\RestF.vbs", 2, true) Ts.WriteLine "Wscript.sleep 50" Ts.close Act.run(SD & "\RestF.vbs"), 1 , True On Error Resume Next Fso.DeleteFile(SD & "\RestF.vbs") End Function Function Rst2 '''' <!-- ;;;;; SCRIPT THIS IS THE AMOUNT OF TIME IT STOPS 1000 = 1 SECOND ;;;;; --> Dim Ts : Set Ts = Fso.OpenTextFile(SD & "\Rest2.vbs", 2, true) Ts.WriteLine "Wscript.sleep 2200" Ts.close Act.run(SD & "\Rest2.vbs"), 1 , True On Error Resume Next Fso.DeleteFile(SD & "\Rest2.vbs") End Function </Script> <script language="vbscript"> Function Window_Onload Lb1.InnerHTML = Uname & "<BR>Please Type In The Drive Letter<BR>That You Would Like To Remove" &_ "<BR>The Read Only Attributtes From</BR>" Call Rst2 Call RstF SDrv = InputBox("Type In The Drive You Would Like Change The Files Attributes" & vbCrlf &_ vbCrlf & "This Will Change All Read Only Attributes To Write, This Will Take Some Time, It Depends, On How Large The Drives Are And How Many Files It Must Change" &_ vbCrlf & VbCrlf & "You Only Need The Drive Letter" & vbcrlf & "Example Correct Way:" & Vbcrlf & space(3) & "C" &_ space(3) & "D" & space(3) & "E" & space(3) & "F" & Vbcrlf & "Example Wrong Way:" & Vbcrlf & space(3) & "C: or C:\" &_ space(3) & "D: or D:\" & space(3) & "E: or E:\" & space(3) & "F: or F:\" &_ Vbcrlf & "Press Cancel To Exit This And Close The Window","Gsm Change Read Properties") If SDrv = "" Then Lb1.InnerHTML = "No Drive Was Selected <BR>Preparing To Exit" Call Rst2 Window.close Exit Function Else Lb1.InnerHTML = Uname & ", This Script Is Active<BR>When This Windows closes Then The Script Has Ended" Rst2 Change End If End Function Function Change Const READ_ONLY = 1 strComputer = "."' Set objFSO = CreateObject("Scripting.FileSystemObject") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile where Drive = '" & SDrv & ":' AND Writeable = FALSE") For Each objFile in colFiles Set objReadOnlyFile = Fso.GetFile(objFile.Name) objReadOnlyFile.Attributes = objReadOnlyFile.Attributes XOR READ_ONLY Lb2.InnerHTML = "Changing This file Attributes<BR>" & objFile.Name & "</BR>" RstF Next Lb1.InnerHTML = Uname & ", Completed The Search" Lb2.InnerHTML = "Goodbye" Call Rst2 Call Rst2 Window.close End Function </Script> <!-- ============ START OF THE HTA BACKGROUND ============ --> <body SCROLL="no" STYLE= "8.75pt Palatino Linotype; color:#006c6c; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#e8e4de', EndColorStr='#c7c3be')"> <!--[if gte vml 1]><v:background id="_x0000_s1025" o:bwmode="white" Scroll="NO" fillcolor="#c7c3be" o:targetscreensize="365,215"> <v:fill color2="Orange", focusposition=".75,-.75" focussize="100" type="gradientRadial"/></v:background><![endif]--> <Center> <Table><Font STYLE="font:8.75pt Palatino Linotype;color:#0000ab;font-weight:Bold-Italic"> <BR><span id=Lb1></Span> <BR><span id=Lb2></Span> Edited December 28, 2005 by gunsmokingman
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now