Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make folders visible
Message
From
23/09/2018 11:53:49
 
General information
Forum:
Windows
Category:
Computing in general
Miscellaneous
Thread ID:
01662206
Message ID:
01662209
Views:
36
>>>Hi,
>>>
>>>I copy files from my computer to an external drive using robocopy command. I can get to the files on the external drive by going to a command prompt and using CD dirname. But when I open the external drive using Windows Explorer, the folders appear to be empty.
>>>
>>>How do I make all folders on the external drive visible?
>>
>>If you Robocopy the files while File Explorer is open, you may need to refresh File Explorer (F5 key). I've seen cases where that doesn't work, and I've needed to close, then re-open File Explorer.
>
>I can't think that this issue has anything to do with whether File Explorer (or Windows Explorer) is open or not during the Robocopy. It is just that I can unplug the external drive, plug it back in, no matter what, when I open the Windows Explorer I see only the top folder where I started Robocopying the files.
>Example:
>The top folder on the drive is H:\DELL1234 (name of the computer which I back up). Then, under H:\DELL1234 is DRIVE_D folder, I can see this folder from Windows Explorer. Under DRIVE_D should be BACKPUK1 and I don't see this folder, no any other folders and/or files below BACKUP1. The Robocopy command syntax is:
>
>
>robocopy d: h:\dell1234\drive_d\backup1\  /mir 
>
>
>Thank you.

In my chest of tools and utility programs, I have this program which you can use to reset the hidden attributes:
*ChangeTreeAttr.prg
**DO changetreeattr WITH 'c:\dir\*.*','N' && To reset
**DO changetreeattr WITH 'c:\dir\*.*','R' && Readonly

Procedure changetreeattr
   Lparameters lcFileSkeleton, lcAttributes, lcCursor
   Local lcSelect As String, ;
      lnProcessed As Number
   Local lcAttributes1 As String
   lcSelect = Select()
   lnProcessed = 0
   lcAttributes1 = []
   Select 0
   If Pcount() < 3 Or Vartype(lcCursor) # [C]
      lcCursor = [curFiles]
   Endif
   Do RecurseDirectories With lcFileSkeleton, lcAttributes1, .F., lcCursor
   Scan
      setattr(Fullpath, lcAttributes)
   Endscan
   lnProcessed = Reccount()
   Use
   Select (lcSelect)
   Wait Clear
   Return lnProcessed

****************************************
Procedure RecurseDirectories
   Lparameters lcFileSkeleton, lcAttributes, llKeepDirectory, lcCursor
   Local Array laDirectory[1, 1]
   Local lnFileCount As Integer
   Local lnCounter As Integer
   Local lcCurrentPath As Varchar(200)
   If Empty(llKeepDirectory)
      llKeepDirectory = .F.
   Endif
   If !llKeepDirectory
      Create Cursor (lcCursor);
         (Fullpath Varchar(200), filepath Varchar(200), filename Varchar(80), ext Varchar(4), filesize Integer, FullName Varchar(100),  ModiDate Date, ModiTime Char(16), FileAttr Char(6))
   Endif
   If Empty(lcFileSkeleton)
      lcFileSkeleton = [*.*]
   Endif
   If Empty(lcAttributes)
      lcAttributes = [DHS]
   Endif
   lnFileCount = Adir(laDirectory, lcFileSkeleton, lcAttributes)
   lcCurrentPath = Justpath(lcFileSkeleton)
   Wait [Processing: ] + Alltrim(lcCurrentPath) + [..hang on!] Window Nowait
   If lnFileCount > 0
      For lnCounter = 1 To lnFileCount
         If !Empty(Strtran(laDirectory[lncounter, 1], [.], []))
            If [D] $ laDirectory[lncounter, 5] && directory - need to recursively call!
               RecurseDirectories(Addbs(lcCurrentPath) + Addbs(Trim(laDirectory[lncounter, 1])) + Justfname(lcFileSkeleton), lcAttributes, .T., lcCursor)
            Else
               Insert Into (lcCursor) (Fullpath, filepath, FullName, filename, ext, filesize, ModiDate, ModiTime, FileAttr);
                  Values (Addbs(lcCurrentPath) +  laDirectory[lncounter, 1], lcCurrentPath, laDirectory[lncounter, 1], Juststem(laDirectory[lncounter, 1]), Justext(laDirectory[lncounter, 1]), laDirectory[lncounter, 2], laDirectory[lncounter, 3], laDirectory[lncounter, 4], laDirectory[lncounter, 5])
            Endif
         Endif
      Endfor
   Endif
   Return
****************************************
Function setattr
   Parameter tFileName, tAttribute
   tAttribute = Upper(tAttribute)
   Private nAttribute
   nAttribute = 0
   If [S] $ tAttribute && System
      nAttribute = nAttribute + 4
   Endif
   If [H] $ tAttribute && Hidden
      nAttribute = nAttribute + 2
   Endif
   If [R] $ tAttribute && ReadOnly
      nAttribute = nAttribute + 1
   Endif
   If [A] $ tAttribute && Archive
      nAttribute = nAttribute + 32
   Endif
   If [N] $ tAttribute && Normal
      nAttribute = nAttribute + 128
   Endif
   Declare Integer SetFileAttributes In kernel32 String, Integer
   Return SetFileAttributes(tFileName, nAttribute) = 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform