Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-27
5
Medium Priority
?
2,075 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 750 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 …
Simple Linear Regression

597 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