+ Reply to Thread
Results 1 to 3 of 3

maybe to bob phillips -next folder?

  1. #1
    Alvin Hansen
    Guest

    maybe to bob phillips -next folder?

    Hi
    I use this code:
    Set fso3 = CreateObject("Scripting.FileSystemObject")
    Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
    For Each fldr In folderobj.subFolders

    For Each file In fldr.Files
    myattr = file.Attributes
    If myattr = 33 Then
    ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
    ", vbOKCancel)
    If ind = vbOK Then
    fso3.deletefile file, True
    End If
    Else
    fso3.deletefile file
    End If
    Next file
    fldr.Delete force:=True
    Next fldr

    well its working but if i have a folder and in this have anew folder with a
    file read only i dont get to the file?

    Regards alvin


  2. #2
    Bob Phillips
    Guest

    Re: maybe to bob phillips -next folder?

    Hi Alovin,

    If you want to check folders in a folder as well, you could add an
    independent loop

    For Each fldr2 in fldr.SubFolders
    'etc
    Next fldr2

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Alvin Hansen" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I use this code:
    > Set fso3 = CreateObject("Scripting.FileSystemObject")
    > Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
    > For Each fldr In folderobj.subFolders
    >
    > For Each file In fldr.Files
    > myattr = file.Attributes
    > If myattr = 33 Then
    > ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
    > ", vbOKCancel)
    > If ind = vbOK Then
    > fso3.deletefile file, True
    > End If
    > Else
    > fso3.deletefile file
    > End If
    > Next file
    > fldr.Delete force:=True
    > Next fldr
    >
    > well its working but if i have a folder and in this have anew folder with

    a
    > file read only i dont get to the file?
    >
    > Regards alvin
    >




  3. #3
    Alvin Hansen
    Guest

    Re: maybe to bob phillips -next folder?

    Hi bob
    Thanks.

    regards alvin


    "Bob Phillips" skrev:

    > Hi Alovin,
    >
    > If you want to check folders in a folder as well, you could add an
    > independent loop
    >
    > For Each fldr2 in fldr.SubFolders
    > 'etc
    > Next fldr2
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Alvin Hansen" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi
    > > I use this code:
    > > Set fso3 = CreateObject("Scripting.FileSystemObject")
    > > Set folderobj = fso3.GetFolder("c:\" & tt & tal & kur1)
    > > For Each fldr In folderobj.subFolders
    > >
    > > For Each file In fldr.Files
    > > myattr = file.Attributes
    > > If myattr = 33 Then
    > > ind = MsgBox("Filen " & file.name & " er skrivebeskyttet skal den slettes?
    > > ", vbOKCancel)
    > > If ind = vbOK Then
    > > fso3.deletefile file, True
    > > End If
    > > Else
    > > fso3.deletefile file
    > > End If
    > > Next file
    > > fldr.Delete force:=True
    > > Next fldr
    > >
    > > well its working but if i have a folder and in this have anew folder with

    > a
    > > file read only i dont get to the file?
    > >
    > > Regards alvin
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1