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

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?
tclough59Asked:
Who is Participating?
 
avatar-eConnect With a Mentor Commented:
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
 
avatar-eCommented:
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
 
tclough59Author Commented:
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
 
tclough59Author Commented:
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
 
tclough59Author Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.