Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

786 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