Announcement

Collapse
No announcement yet.

Rename file using GPO

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

  • Rename file using GPO

    Hi ,
    I need to deploy one script it can be vbs or bat ,which rename the file as link given

    Rename "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\outlook.nk2" "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\%username%.bak"

    when i am executing this command it display syntax error.

    Can any one help me out how can i rename the file..

  • #2
    Re: Rename file using GPO

    Why don't you post the error here so that we have a clue.

    Comment


    • #3
      Re: Rename file using GPO

      when i am running that script in single machine i am getting below error.....


      C:\>Rename "C:\Documents and Settings\ithelp\Application Data\Microsoft
      \Outlook\outlook.nk2" "C:\Documents and Settings\ithelp\Application Dat
      a\Microsoft\Outlook\ithelp.bak"
      The syntax of the command is incorrect.

      & batch file is syntax ....

      Rename "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\outlook.nk2" "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\%username%.bak"

      Comment


      • #4
        Re: Rename file using GPO

        I think the problem is that in the destination you should not be specifying the drive letter or the path. The command should be:

        Rename "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\outlook.nk2" %username%.bak

        Comment


        • #5
          Re: Rename file using GPO

          thanks its working

          However i need to execute reg command without user notification thru GP
          I know i can deployed through Reg ADD command anyhow i am not able to deployed reg file

          below is the registry setting which need to deployed..

          [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\O utlook\Preferences]
          "ShowAutoSug"=dword:00000000

          Comment


          • #6
            REN "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Application Data\Microsoft\Outlook\outlook.nk2" "%USERNAME%.nk2.bak"

            This should do the trick, make sure it's a USER based GPO, it won't work if you make the GPO in the Computer Configuration section.
            Last edited by vickardis; 26th January 2018, 15:57.

            Comment


            • #7
              Ahem... check the dates of the last post.....
              Tom Jones
              MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
              PhD, MSc, FIAP, MIITT
              IT Trainer / Consultant
              Ossian Ltd
              Scotland

              ** Remember to give credit where credit is due and leave reputation points where appropriate **

              Comment

              Working...
              X