Announcement

Collapse
No announcement yet.

FILEATTR and Windows-10

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Alrighty then. Note: I don't use OneDrive. Thankfully.
    Sad to say, if it's not backup on my USB drives or NAS then I'm out of luck. Band width here is scarce. But then living in a forest has its pros too.

    Comment


    • #22
      Change Read-only attributes of folders in Windows

      Read only folders

      Comment


      • #23
        I thought the takeown would work for you.
        Did you happen to check if drive D is shared because of OneDrive? Unlikely.
        NET SHARE at a command prompt.

        Nothing has worked, God mode:
        https://forum.powerbasic.com/forum/t...ndows-7-8-1-10
        Last edited by Mike Doty; 17 Apr 2020, 12:46 AM.
        How long is an idea? Write it down.

        Comment


        • #24
          Well, OK then! Here's my update:

          Thank goodness I got some sleep last night, because I woke up with clearer thoughts... I've been able to create files with other programs, and the RO attribute has probably been present without my knowing it, so this really isn't about the operating system, it's about my code. (I call that "clearing the debugger's blind spot")

          1. As per the links provided by Pierre (thank you!), Windows ignores the RO attribute of folders (then why set it on ALL of them?)
          2. The ATTR command in cmd.exe DOES NOT RESET the RO attribute.
          3. Based on these two facts, it is useless to use the result of PB's GETATTER statement to rely on folder RO status.
          4. Just running headlong into a RO folder and writing to it (although totally counter-intuitive) appears to be a fine strategy.

          Here's where my code had been going wrong:
          Code:
             sDestIndividualFolder = sDestRootFolder & REMAIN$(sGroups(i), $TAB) & "\"
             IF ISFALSE ISFOLDER(sDestIndividualFolder) THEN MKDIR sDestIndividualFolder
             IF GETATTR(sDestIndividualFolder) <> %NORMAL THEN
                SETATTR sDestIndividualFolder, %NORMAL
             END IF
             ? "Attributes of: " & sDestIndividualFolder & " = " & STR$(GETATTR(sDestIndividualFolder)) : WAITKEY$       ' FOR DEBUGGING ONLY
             IF GETATTR(sDestIndividualFolder) <> %NORMAL THEN EXIT FUNCTION

          So I've bypassed the (useless) GETATTR = NORMAL tests and everything is working just fine.

          I don't regret all the time I've spent trying to eliminate each possibility, but I do regret that I didn't think earlier to challenge my assumption about the "rightness" of my code.
          Horrified by not being able to reset the RO attribute on the folder, I got caught in that rabbit hole. And believe me, I read dozens of articles complaining about the problem tried all kinds of suggested fixes, and none had a solution that worked. I just never hit the two most valuable articles, the ones that Pierre provided.

          But it was Jim's confirmation that my situation was 1) not unique, and 2) one that he had no problem with, that helped break me out of the rut I was in.

          One other thing... Along the way, I've also been struggling with the way Win10 and Office 365 and OneDrive are designed to store and share everything in the cloud, while I still like sharing only a few things, and only when I need to. I like and want and still rely on having everything local. So I was also fueled by my discontent in wresting back control from these octopus programs...

          The answer to that is: Tell OneDrive to stop synching files, and then to "unlink this PC". To defeat Office365's default of saving your files to the cloud, you have to go into File Explorer, and set everything to "keep on this device". What a pain!

          So I'm moving on to the next phase, and appreciate the help received. And Mike, I will definitely be checking out God Mode! Looks like it might be handy.

          Thanks,
          -John

          Comment


          • #25
            Yup, the code is where it's at.

            Glad we could help.

            Comment


            • #26
              In my past, I usually set the previlieges on drives on drives other than the OS drive to either everyone or Users.
              Except where I have too, when folders are created, I create then as a User rather than administrator but we only have one User Account per computer. I try to keep data files on a Linux server where Raid 1 is being used and imuse XCOPY to back up files to local non OS drives. This helps reduce my OS drive size that is usually C: down to a smaller size for back up purposes and imaging. Using XCOPY to copy fully directories is really fast when using the option to copy only changed files and new files. I literally dislike non SSD drives but those do have large drive capacity.
              Nothing is private on work related machines so that is not an issue.
              p purvis

              Comment


              • #27
                I looked at some running windows XP sp3 machines tonight and they are show what was explained above where the read only attribute is set on and changing it makes no difference even by the administrator account and it would appear it you can change it it but it bounces right back to to read only status. You make the change as if all is happening properly, then you go back and it is like a person you cannot shake off. It is still there with initial settings. Kind of reminds me of myself.
                p purvis

                Comment


                • #28
                  Paul,
                  See Pierre's top link in post #22. It explains the process pretty well. Folders need to have RO or System properties to have special visual features.

                  Comment

                  Working...
                  X