Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file to turn off read only on a roaming folder.  (Read 5079 times)

0 Members and 2 Guests are viewing this topic.

jimolibob

    Topic Starter


    Greenhorn

    • Experience: Familiar
    • OS: Windows 7
    Batch file to turn off read only on a roaming folder.
    « on: April 01, 2015, 08:32:37 AM »
    Dear, members
    Thank you for any help you are able to give on my very first post here in the computer hope forum.

    I need to deploy a batch file that will remove the read only settings of a folder (or rather its contents) for users on a domain.

    The folder is located here:
    username>AppData>Roaming>Microsoft>Signatures

    I've installed some signature software but unless the users manually goes and un-ticks the read only box under permissions for this folder it doesn't run.

    Does anyone know if you could create a bat file that can do this and then be deployed via logon script?

    Many thanks to anyone that can help.

    James

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Batch file to turn off read only on a roaming folder.
    « Reply #1 on: April 01, 2015, 09:21:52 AM »
    Are you using batch or vbscript for your current logon script?

    jimolibob

      Topic Starter


      Greenhorn

      • Experience: Familiar
      • OS: Windows 7
      Re: Batch file to turn off read only on a roaming folder.
      « Reply #2 on: April 02, 2015, 03:11:01 AM »
      They're .bat files

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      Re: Batch file to turn off read only on a roaming folder.
      « Reply #3 on: April 02, 2015, 06:34:16 AM »
      So what is stopping you from adding the attrib command to the login script?

      jimolibob

        Topic Starter


        Greenhorn

        • Experience: Familiar
        • OS: Windows 7
        Re: Batch file to turn off read only on a roaming folder.
        « Reply #4 on: April 02, 2015, 06:54:34 AM »
        Not knowing what that is and how to go about it.  :)
        I'm very much a newbie. If anyone can recommend a good resource for learning about how to write bat files that would also be appreciated. Thanks for helping if you can.

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Batch file to turn off read only on a roaming folder.
        « Reply #5 on: April 02, 2015, 07:09:08 AM »
        An A-Z Index of the Windows CMD command line
        Batch Guide

        Code: [Select]
        attrib -R "%appdata%\Microsoft\Signatures"

        jimolibob

          Topic Starter


          Greenhorn

          • Experience: Familiar
          • OS: Windows 7
          Re: Batch file to turn off read only on a roaming folder.
          « Reply #6 on: April 02, 2015, 07:38:50 AM »
          Thank you, Squashman!

          patio

          • Moderator


          • Genius
          • Maud' Dib
          • Thanked: 1769
            • Yes
          • Experience: Beginner
          • OS: Windows 7
          Re: Batch file to turn off read only on a roaming folder.
          « Reply #7 on: April 02, 2015, 07:44:08 AM »
          Give a man a fish he'll eat for a day...teach a man to fish and he'll spend all day in a boat drinking Beer...
          " Anyone who goes to a psychiatrist should have his head examined. "

          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: Batch file to turn off read only on a roaming folder.
          « Reply #8 on: April 02, 2015, 07:55:08 AM »
          Give a man a fish he'll eat for a day...teach a man to fish and he'll spend all day in a boat drinking Beer...
          +1
          That is my favorite adaptation of those words of wisdom!

          jimolibob

            Topic Starter


            Greenhorn

            • Experience: Familiar
            • OS: Windows 7
            Re: Batch file to turn off read only on a roaming folder.
            « Reply #9 on: April 02, 2015, 07:55:43 AM »
            OK, That didn't work.

            I've tried it on my script and it looks like this. Am I doing it correctly?

            @echo off

            REM Set local clock to server time

            call Global.bat
            call IT.bat
            call emailsigs.bat

            attrib -R "%appdata%\Microsoft\Signatures\

            EXIT

            patio

            • Moderator


            • Genius
            • Maud' Dib
            • Thanked: 1769
              • Yes
            • Experience: Beginner
            • OS: Windows 7
            Re: Batch file to turn off read only on a roaming folder.
            « Reply #10 on: April 02, 2015, 08:01:16 AM »
            +1
            That is my favorite adaptation of those words of wisdom!


             ;D     ;D
            " Anyone who goes to a psychiatrist should have his head examined. "

            Squashman



              Specialist
            • Thanked: 134
            • Experience: Experienced
            • OS: Other
            Re: Batch file to turn off read only on a roaming folder.
            « Reply #11 on: April 02, 2015, 08:43:45 AM »
            Try testing some of the commands manually.
            Code: [Select]
            C:\>attrib "%appdata%\Microsoft\Signatures"
                    I    C:\Users\Squashman\AppData\Roaming\Microsoft\Signatures

            C:\>attrib +R "%appdata%\Microsoft\Signatures"

            C:\>attrib "%appdata%\Microsoft\Signatures"
                 R  I    C:\Users\Squashman\AppData\Roaming\Microsoft\Signatures

            C:\>attrib -R "%appdata%\Microsoft\Signatures"

            C:\>attrib "%appdata%\Microsoft\Signatures"
                    I    C:\Users\Squashman\AppData\Roaming\Microsoft\Signatures

            jimolibob

              Topic Starter


              Greenhorn

              • Experience: Familiar
              • OS: Windows 7
              Re: Batch file to turn off read only on a roaming folder.
              « Reply #12 on: April 07, 2015, 03:14:35 AM »
              Sorry been away for Easter.

              Turns out this is what worked in case anyone else wants to know:

              attrib -R %appdata%\Microsoft\Signatures\*.* /s

              Thanks for your help Squashman!

              Squashman



                Specialist
              • Thanked: 134
              • Experience: Experienced
              • OS: Other
              Re: Batch file to turn off read only on a roaming folder.
              « Reply #13 on: April 07, 2015, 06:16:26 AM »
              When you described the problem you clearly said all the person had to do was toggle the read only on the signatures folder. So you get the code for which you described your problem.

              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: Batch file to turn off read only on a roaming folder.
              « Reply #14 on: April 07, 2015, 08:17:33 AM »
              I was going to mention the same thing but in the Original Post they did mention in parentheses that they really wanted to deal with the folder contents.
              I was trying to dereference Null Pointers before it was cool.