round2it Posted August 3, 2015 Posted August 3, 2015 Hi everyone I am currently migrating to a ne exchange server (went well) and I have a small issue that you guys might be able to help me with. when I did my admin configurations of office 2010 I put in my old exchange server name into the config file this worked prior to the migration as it should. stupidly I did not use the ip address but the name now the exchange server has a different name as I was running both in tandem. My problem is that I need to copy over a edited prf into the c:\program files\Microsoft office\office14 folder the file is currently set to read only as it should. how would you replace the file and then set it to read only by script. the file that needs changing is outlook.prf its the set to read only part that I have not worked out and as the file is currently read only would this cause a problem with a direct copy. I could recreate the office setup and uninstall then reinstall office but this would be a royal pain in the backside. your help on this would be fantastic
round2it Posted August 3, 2015 Author Posted August 3, 2015 do you think that the source file is read only will be an issue?
anthonyd Posted August 3, 2015 Posted August 3, 2015 We did this a couple of years ago with this script run at startup, I'm not 100% on if ours were read only or not, but if that proves to be an issue you can change the read only property with a couple of VBS lines: How Can I Change a Read-only File to a Read-write File? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs OPTION EXPLICIT Dim objFSO, oExec, wshShell, objLogFile Const ForWriting = 2 Set wshShell = WScript.CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") If Not objFSO.FileExists("C:\ChangeOutlook2010PRFDone.txt") Then If objFSO.FileExists("C:\Program Files\Microsoft Office\custom14.prf") Then objFSO.DeleteFile "C:\Program Files\Microsoft Office\custom14.prf", True objFSO.CopyFile "\\server\share\custom14.prf", "C:\Program Files\Microsoft Office" End If Set objLogFile = objFSO.CreateTextFile("C:\ChangeOutlook2010PRFDone.txt", ForWriting, True) End If 1
round2it Posted August 3, 2015 Author Posted August 3, 2015 I have got a vbs to change the file to read /write but the above script fails on line 15 with access denied maybe if i put the file in the sysvol scripts then it might work setup as a startup script (believe this is correct) not sure why i am finding this so hard
round2it Posted August 3, 2015 Author Posted August 3, 2015 Sorted it thankyou All i had to do was use Group policy Prefs to replace the file (first time using gpp) amazed at how it worked. gpupdated a machine and the file was replaced.Thanks @anthonyd i learnt something new today. Thanks everyone
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now