Disk Operations

  • Uploaded by: MANOJ
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Disk Operations as PDF for free.

More details

  • Words: 1,141
  • Pages: 13
. ല ലെട  ക .  ക മേനാജ് മാ എ.പി വിഷ  േബയ് സിിനകനിെകാ തെ" പല ഡിസ് ക് ഓപേറഷകളം െച)ാനാവം. ഇ+ര+ില- പല കാര./ളം നിലവില- െ0ാജക 1 ിെ2 േമ345ാപകരി6ം. 0ധാനമായം ര് ഡിസ് ക് ഓപേറഷകളി നാമിവിെട െച)ാ8 േപാ"ത് .ഇതി ആദ.േ+ത് ഹാഡിസ് കിെ2 ബാക് െ<ൗിേല് ചി>/ േചാ8 സഹായി6"?ം, രാമേ+ത് സിഡി ?റാം അടാം സഹായി6" േ0ാ<ാമി/ം മാണ് . ഹാഡ് ഡിസ് ക് ൈDവകളെട ബാക് െ<ൗിേല് ചി>ം േചാ8. േചാ8.

1 ് ആദ.മായി െ0ാജക് ടിേല് െടക E ് F് േബാക E G ം,കമാ2് ബ5H,ലിസ 1 ് േബാക േബാക E ് ,ഇേമജ് ,േകാമH ഡയേലാഗ് ,ൈDവ് ലിസ E ് , െസF്

ബാക് െ<ൗ് ,റിമവ് ബാക് െ<ൗ് ,കാ8സ എ"ി/െന കാപ് ഷേനാട4ടിയ മ"് കമാ2് ബ5കളം േച6ക. കേJാളകെള ശരിയായ രീതിയി Mമീകരി6"തിനായി െNയിം കേJാളിെന 1 ് ഉപേയാഗെPട+ാം.ഇതി േകാമH ഡയേലാഗ് േബാക E ് , ൈDവ് ലിസ േബാക E ് എ"ിവ േ0ാ<ാം 0വ+ിPി6േQാ കാണാ+വിധ+ി Mമീകരി6ക.

ബാക് െ<ൗ് ചി>ം െസF് െച)"ത് െഡസ് ക് േടാപ് .ഐ.8.ഐ[desktop.ini] ഫയലിെ2 സഹായേ+ാട4ടിയാണ് .ഈ ഫയ ഉാ6"തിം , ഉോ ഇല ` േയാ എ പരിേശാധി6"തിനായി ര ഫങ് ഷക ഊാേ?് . താെഴ കാd" രീതിയി ഇവ ഒf െമാഡ.ളിേല് േച6ക. 1 ം ൈടPം,ഏതാം േവരിയബിളകളം ഇതി മേ"ാടിയായി ഒf കസ വിേ2ാസ് േകണ 32[kernal32] ൈലmറിയില- SearchPathA എ" ഫങ് ഷം ഡിക ` യ െചേ)?് . Private Declare Function SearchPath Lib "kernel32" Alias "SearchPathA" (ByVal lpPath As String, ByVal lpFileName As String, ByVal lpExtension As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long Dim s As String Private Type ini key As String

iconarea As String iconimage As String End Type “Ini“ ൈടപ് വിേ2ാസ് െറജിസ് Jിയിേല6- വാല. സ് േFാ െച)"തിപേയാഗിˆിരി6. Dim a As ini Private Function writeini(path As String, fname As ini) Open path & "\desktop.ini" For Output As #1 Print #1, a.key Print #1, a.iconarea Print #1, a.iconimage Close #1 SetAttr path & "\desktop.ini", vbHidden + vbSystem End Function

ഇവിെട ഫങ് ഷന് ര് ആഗ.െമ2കളാd-ത് , പാം,ബാക് െ<ൗ് പിക് ച  ഫയലിെ2 വിവര/ളം. ഈ വിവര/ വി.ബി ഫയ ഉപേയാഗിˆ് desktop.ini എ" േപരില- ഒf സിസFം ഫയലിേല് േച6. Public Function searchini(drive As String) As Boolean

Dim error As Boolean error = True On Error GoTo handle s = GetAttr(drive & "\desktop.ini") searchini = True error = False handle: If error = True Then searchini = False End If End Function രാമെ+ ഫങ് ഷനായ searchini desktop.ini എ" േപരി ഒf ഫയ ഉോഎ"റിയാ8 നെ• സഹായി6 Public Function setbackground(fname As String, path As String) a.key = "[{BE098140-A513-11D0-A3A4-00C04FD706EC}]" a.iconarea = "iconarea_image=" & fname a.iconimage = "iconarea_text=0x00FFFFFF" writeini path, a End Function

Setbackground എ" ഫങ് ഷനാണ് ഈ േ0ാ<ാമിെ2 ഏFവം മ•0ധാനമായ ഭാഗം.ഈ ഫങ് ഷന് 0ധാനമായം ര് ആഗ.െമ2കളാd-ത് , ആദ.േ+ത് ഫയലിെ2 േപfം ,രാമേ+ത് പാം ആണ് . മ8പ് ഉാിയ Writeini ഫങ് ഷ8 ഉപേയാഗിˆ് ബാക് െ<ൗ് ഫയ സംബ£മായ വിവര/ ഫയലിേല് േച+ിരി6. ഇനി േഫാമി േശഷി6" കാര./ 4ടി െചയ് ? തീേ?് . ആദ.മായി kernel32 ല- GetDriveTypeA എ" ഫങ് ഷ8 ഡിക ` യ െചേ)?് . ഹാഡ് ഡിസ് കിെ2 ബാക് െ<ൗ് മാ>െമ െസF് െച)ാനാവ എ"?െകാ് , െസലക് ട് െച)" ൈDവ് ഹാഡ് ഡിസ് ക് പാ5ീഷനാെണ"് ഉറPവfേ+ത് ആവശ.മാണ് , ഇതിനായി ഈ ഫങ് ഷ8 ഉപേയാഗിˆിരി6. താെഴ കാd"േപാെല ഇവ േഫാമിെ2 ജനറ െസ¤നിേല് േച6ക.

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Dim fname As String 1 ് േബാക ഇനി േഫാമിെ2 േലാഡ് ഇവ2ിേല് ൈDവ് ലിസ E ി നിം 1 ് േച6കയാണ് െചേ)ത് ഇതിനാ താെഴ ൈDവകളെട ലിസ കാd" ഭാഗം േകാഡ് വിെ2ായി േച6ക. Private Sub Form_Load() List1.Clear Dim dtype For i = 0 To Drive1.ListCount - 1 dtype = GetDriveType(Left(Drive1.List(i), 2)) If dtype = 3 Then

If searchini(Left(Drive1.List(i), 2)) = True Then List1.AddItem Drive1.List(i) & " Background Exist" Else List1.AddItem Drive1.List(i) End If End If Next i End Sub

ഇവിെട GetDriveType ഫങ് ഷ8 ഉപേയാഗിˆ് ൈDവ് ഹാഡ് ദിസ് ക്

1 ് േബാക തെ"യാെണ"് ഉറPവf+ിയ േശഷമാണ് അവ ലിസ E ിേല് േച+ിരി6"ത് . Searchini ഫങ് ഷ8 ഉപേയാഗിˆ് ൈDവിെ2 ini വിവര/ േസവ് െച)െP5ി5ോ എറPവf, ഉെ¥ി 1 ് േബാക 1 ് Background Exist എ"് ലിസ E ിേല് േച6. ൈDവ് ലിസ േബാക E ് എ¦ിനാണ് ൈഹഡ് െചയ് ത് െവˆിരി6"ത് എ"് E ിലായി കാdമേല മനസ ` ാ. ചി>ം തിരെ§ട6"തി- കമാ2് ബ5െ2 ക ` ി് ഇവ2ിേല് താെഴ കാd" േകാഡ് േച6ക. Private Sub BrowsPictureBTN_Click() With CommonDialog1 .DialogTitle = "Select Picture" .Filter = "All Supported Images |*.bmp;*.jpeg;*.jpg" .ShowOpen Text1.Text = .FileName Image1.Picture = LoadPicture(.FileName) End With

If Text1.Text <> "" Then fname = Text1.Text End If End Sub

ഇനി ബാ് െ<ൗ് െസF് െച)ാ- ബ5െ2 ക ` ിിേല് താെഴ കാd" േകാഡ് േചാം . Private Sub SetBkgrdBTN_Click() Dim c c=0 If Text1.Text <> "" Then For i = 0 To List1.ListCount - 1 If List1.Selected(i) = True Then MsgBox "drive " & List1.List(i) & "selected" setbackground fname, Left(List1.List(i), 2) c=c+1 End If Next Else MsgBox "Please select background first..", vbInformation End If If c = 0 And Text1.Text <> "" Then MsgBox "Please select drive from listbox !", vbInformation

Else MsgBox "Now " & c & " drive(s) has background(s) !", vbInformation End If Form_Load End Sub ഇനി അവസാനഭാഗമായ ബാക് െ<ൗ് കളയാ- േകാഡ4ടി േച+ാ െ0ാജക 1 ിേല് േചാം Private Sub Command4_Click() 'On Error Resume Next Dim c c=0 List1.ListIndex = 0 For i = 0 To List1.ListCount - 1 If List1.Selected(i) = True Then SetAttr Left(List1.List(i), 2) & "\desktop.ini", vbNormal Kill Left(List1.List(i), 2) & "\desktop.ini" c=c+1 End If Next i

If c = 0 Then MsgBox "No background has been removed from selected drives", vbInformation Else MsgBox c & " drive(s) have been reset", vbInformation End If Form_Load End Sub ഇവിെട ഏെതാെ ൈDവികളാണ് െസലക 1 ് െചയ് തിരി6"ത് എ"റിയ"തിനായി ലP് ഉപേയാഗിˆിരി6.4ടാെത െസലക് ട െചയ് ത ൈDവകളെട ini വിവര/ desktop.ini  നിം ഡിലീF് െച)"തിനായി ഫയലിെ2 ആJിബ.5ക േനാമലായി െസF് െചയ് ത േശഷം Kill ഫ് ങ് ഷ8 ഉപേയാഗിˆ് വിവര/ ഫയലി നിം നീകം െചയ് തിരി6. ഇനിേ0ാ<ാം 0വ+ിPിˆേനാാം.

സി. സി.ഡി. ഡി.ഓപേറഷക വി. വി.ബി. ബി.യിലെട 1 +ിെല ഡിഫാ5് െ0ാ<ാമിനകനിെകാതെ" സിസ സി.ഡി.ൈDവ് അടാം ?റാമാവം. ഇതിനായി ചില ഫങ് ഷക ത)ാറാണം എമാ>ം. ഇവിെട mciSendString എ" ഫങ് ഷ8 CDDriveOperation എ" ഫങ് ഷനക+ായി ഉപേയാഗിˆിരി6,ഇ/െന െച)"തി മ8പായി ഈ ൈലmറി

ഫങ് ഷ8 ഡിക ` യ െചേ)?് . താെഴ കാd" ഫങ് ഷകളം ഡിക ` േറചം േകാഡ് വിെ2ാവിേല് േച6ക. Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Function CDDriveOperation(ByVal Command As String, ByVal hwnd As Long) As String Dim Buff As String Dim dwR As Long Buff = Space$(100) ' Create a buffer dwR = mciSendString(Command, ByVal Buff, Len(Buff), hwnd) CDDriveOperation = Buff End Function സിഡി ൈDവ് ?റാം അടാമ- സ് Jിങ് കമാ2ക െകാടലാണ് അട+ത് .ഇത് താെഴ കാd" േപാെല െ0ാസീഡ. ആെയാ , ഏെത¥ിലം കേ´ാളിെ2 ഇവ2ി-ിേലാ ആയി ഉപേയാഗിാം. Public Sub CloseCDDoor() Dim ret As String ret = CDDriveOperation("set cdaudio door closed", 0)

End Sub Public Sub OpenCDDoor() Dim ret As String ret = CDDriveOperation("set cdaudio door open", 0) End Sub മകളി കാd" േകാഡ് ഒf െമാഡ.ളി െച)കയാെണ¥ി ആവ+ിˆ് മFെ0ാജക 1 G കളിേല6ം ഈ ഫങ് ഷണാലിFി േചാവ"താണ് . 0ിശീലന+ിനായി

1 +ിെല സി.ഡി.ൈDവക മാ>ം ഒf ലിസ 1 ് േബാക 1. സിസ E ിേല് േചാ- ഒf േ0ാ<ാം ത)ാറാ6ക. • വാല. 5 ഉപേയാഗിˆ െകാ് സിഡി ൈDവിെന കെ+ാം. 1 ് േബാക 2. മകളി െചയ് ത േ0ാ<ാമിേല് , ലിസ E ിെ2 െലഫ 1 ് ബ5H ക ` ി് െച)േQാ ൈDവ് ?റാം ൈറF് ബ5H ക ` ി് െച)േQാ അടാമ- െസൗകര.ം േച6ക.

Related Documents

Disk Operations
May 2020 14
Disk
October 2019 37
Disk.
November 2019 32
Operations
December 2019 29
Operations
June 2020 9
Disk 4
November 2019 21

More Documents from ""