Solved

Modify Registry to change offline editing files to the web server for Office Word 2007

Posted on 2007-11-27
5
2,069 Views
Last Modified: 2008-09-08
I'm needing to create a registry key that will change the option in word for "Offline editing options for document management server files" from its default of "The server drafts location on this computer" to "The web server"

This is all under word options -> Save

I found where the key for this is in the registry

[HKEY_USERS\S-1-5-21-1623631216-3319026113-1499202284-7029\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

But as you can see, its dependent on the users SID  I want to be able to deploy this to multiple computers. for example

(Sudo Code)
[HKEY_USERS\ALL-SIDS\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

but of coures I can't just put ALL-SIDS in there.  I was wondering if anybody knew of a better way or maybe a VBScript I could use for this?
0
Comment
Question by:tclough59
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:avatar-e
ID: 20362354
You can access to all the user-sids from here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

In C# you could do this app in a few minutes.
0
 

Author Comment

by:tclough59
ID: 20362424
Yeah I hear you man, I know that is where the SIDs are located, but they are requiring me to find a solution in VBS for other purposes
0
 
LVL 7

Accepted Solution

by:
avatar-e earned 250 total points
ID: 20367768
Save the code to any txt file and rename it to .VBS, then double click it. Check out for the generated "web_server_off.reg"
Dim WshShell, fso, myFile, outFile, myReg, Cmm, dump, wildcard, ot, stringout, output
set WshShell = CreateObject("wscript.Shell")
Set fso = CreateObject("scripting.filesystemobject")
 
myFile = fso.GetSpecialFolder(2) & "\" & fso.GetTempName()
outFile = "web_server_off.reg"
myReg = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
Cmm = "cmd /K reg query " & Chr(34) & myReg & chr(34) & " > " & Chr(34) & myFile & Chr(34)
 
WshShell.Run Cmm,0
 
WScript.Sleep(500)
 
If Not fso.FileExists(myFile) then
WScript.Sleep(1000)	
End if 
 
dump = fso.OpenTextFile(myFile).ReadAll
wildcard = "%%%RIED%WC%%%"
 
ot = "Windows Registry Editor Version 5.00" 
stringout = "[HKEY_USERS\" & wildcard & "\Software\Microsoft\Office\Common\Offline\Options]" & vbcrlf & Chr(34) & "Local" & chr(34) & "=dword:00000000"
 
For Each s In Split(dump,vbCrLf)
	If InStr(s,myReg & "\")>0 Then
		ot = ot & vbCrLf & vbCrLf & Replace(stringout,wildcard,s)
	End If
Next
 
If fso.FileExists(outFile) Then
fso.DeleteFile outFile,True
End If
 
output = fso.OpenTextFile(outFile,2,true).Write(ot)

Open in new window

0
 

Author Comment

by:tclough59
ID: 20454107
This works great except it gives off the wrong output... This is the output the vbs gives

Windows Registry Editor Version 5.00

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-18\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-19\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-20\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1623631216-3319026113-1499202284-7029\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1981630398-735443967-3194323841-1003\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1981630398-735443967-3194323841-500\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000


And this is what the output should be:


Windows Registry Editor Version 5.00

[HKEY_USERS\S-1-5-18\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\S-1-5-19\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\S-1-5-20\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\S-1-5-21-1623631216-3319026113-1499202284-7029\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\S-1-5-21-1981630398-735443967-3194323841-1003\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000

[HKEY_USERS\S-1-5-21-1981630398-735443967-3194323841-500\Software\Microsoft\Office\Common\Offline\Options]
"Local"=dword:00000000
0
 

Author Comment

by:tclough59
ID: 21051713
Thank you!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question