Solved

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

Posted on 2007-11-27
5
2,045 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
  • 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now