Default Folder for UserDocs - Change Registry

Hi

How can I change the default folder for the userdocs, addins, etc… in the registry. I find the registry key where I must change the folder.

[HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 6.0\default\Shared\General\Directories]

“User BQY”="%USER_DOCUMENTS%\My Business Objects Documents\userBQY\"
“User Docs”="%USER_DOCUMENTS%\My Business Objects Documents\userDocs\"

How can i change the UserDocs Folder in a network path and for what is %USER_DOCUMENTS% stands. We have 30 User and everyone has another network path.

Is %USER_DOCUMENTS% a system variable ?

omuth


omuth :de: (BOB member since 2003-04-28)

omuth – you probably can change the directory through BusinessObjects itself.

How about telling us which version of BusinessObjects you are on, so that someone who knows the version can offer you some advice?


Anita Craig :us: (BOB member since 2002-06-17)

Oh sorry I forgot…

We use Version 6.1 B.

We want to change the folder by default.

omuth


omuth :de: (BOB member since 2003-04-28)

We’re still on 5.1.x, so someone else will have to step up the plate with advice about 6.1b…


Anita Craig :us: (BOB member since 2002-06-17)

Yes, the registry automatically resolves it.

You can set it to a new drive like

"User Docs"="X:\\userDocs\\" 

Or you can use system variables like

"User Docs"="%HOME_DRIVE%%HOME_PATH%\\userDocs\\" 

HTH


Hayden_Gill :australia: (BOB member since 2002-08-15)

on 651, it doesn’t work for me (I explain)

at each startup, BO reported create under e:\mes documents the “My Business Objects Documents” and subdirectory (userdocs, addins, template, userbqy, etc) while I would like to put it as it was on v5 (under c:\program files\business objects etc) by default.

I tried to create as mentionned the vars

USER_DOCUMENTS

with value

C:\Program Files\Business Objects
or C:\Program Files\Business Objects\

and add it on system vars (like windir, tmp, number_of_processor) but it carry on create my the “My Business Objects Documents” on “e:\mes documents” and not on C drive :reallymad:

How can i resolve it ? thank you for advance


bernard timbal :fr: (BOB member since 2003-05-26)

%USER_DOCUMENTS% is a user scope variable which will over-ride any system variable of the same name. Its a special variable and should be left alone.

Instead, create yourself a new variable called BO_DOCUMENTS as a system variable and give it the value “C:\Program Files\Business Objects”

Then change the registry settings to:

"User BQY"="%BO_DOCUMENTS%\My Business Objects Documents\userBQY\" 
"User Docs"="%BO_DOCUMENTS%\My Business Objects Documents\userDocs\" 
etc

Or whatever location you want

You don’t even need to use a system variable if you don’t want eg

"User BQY"="C:\Program Files\BusinessObjects\My Business Objects Documents\userBQY\" 
"User Docs"="C:\Program Files\BusinessObjects\My Business Objects Documents\userDocs\" 
etc

HTH


Hayden_Gill :australia: (BOB member since 2002-08-15)

Unfortunately, I have tried yesterday and it doesn’t work !! Ir carry on creating again the folders in My docs

:wah: :wah: :wah: :wah: :wah:


bernard timbal :fr: (BOB member since 2003-05-26)

Your settings are probably already stored under HKCU

The default in HKLM should only copy across when you don’t have any settings in HKCU

Remove the BusinessObjects entries under your user hive and try again


Hayden_Gill :australia: (BOB member since 2002-08-15)

I will try again but I have ever searched in all registry the wrong path BO still recreate but regedit is unable to find it. But maybe the path is not completely hardcoded and stored in another way like %BO_Document% stuff… I will try soon

thank you for your reply in all case


bernard timbal :fr: (BOB member since 2003-05-26)

FYI, I asked BusObj Tech Support how to do this during installation.

This is yet another example of functionality that was available in 5.x but not in 6.x (in this case, 6.5.1). What’s that all about? :confused:

The enhancement request to allow change to the default file locations DURING (not after) installation is ER ID : 23356


KSG :us: (BOB member since 2002-07-17)

Hi Bernard,

Did you resolve this issue. We have a customer on a 6.5 Citrix deployment and need to change the default template settings.


irish_stan :ireland: (BOB member since 2003-05-13)

You just need to edit the registry after installation.

The .vbs script below is what we run after we do an install, you will need to edit it for your environment:


'
' Script to set default registry settings
' 
' Set User file location for 
'   User Docs
'   User Addins
'   User BQY
'   Documents
'   Temp
'   Templates
'   LSI
'
' Also set registry for Custom Addins
' 
' Hayden Gill
' 18/05/2004

Const HKCR=&H80000000 'HKEY_CLASSES_ROOT
Const HKCU=&H80000001 'HKEY_CURRENT_USER
Const HKLM=&H80000002 'HKEY_LOCAL_MACHINE
Const HKU=&H80000003 'HKEY_USERS
Const HKCC=&H80000005 'HKEY_CURRENT_CONFIG

Const REG_SZ=1
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7

Const KEY_QUERY_VALUE=&H1
Const KEY_SET_VALUE=&H2
Const KEY_CREATE_SUB_KEY=&H4
Const KEY_ENUMERATE_SUB_KEYS=&H8
Const KEY_NOTIFY=&H10
Const KEY_CREATE_LINK=&H20
Const DELETE=&H10000
Const READ_CONTROL=&H20000
Const WRITE_DAC=&H40000
Const WRITE_OWNER=&H80000
Const AddInsPath = "M:\Program Files\Business Objects\BusinessObjects Enterprise 6\addins\"

Set WshShell = WScript.CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:!root/default:StdRegProv")



Test = EnumValues(HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories")

Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","User Docs","C:\BUSINESS\USERDOCS\",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","User Addins","C:\BUSINESS\USERDOCS\",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","User BQY","C:\BUSINESS\USERDOCS\",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","Documents","C:\BUSINESS\USERDOCS\",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","Temp","%TEMP%",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","Templates","C:\BUSINESS\UserTemplates\",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","Web Connect","M:\BOAddins",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories","LSI","%USERPROFILE%",REG_SZ)
Call CreateValue (HKLM, "Software\Business Objects\Suite 6.0\default","USERDOCSDIR","C:\BUSINESS\USERDOCS\",REG_SZ)

Test = EnumValues(HKLM, "Software\Business Objects\Suite 6.0\default\Shared\General\Directories")


'
'Display and Set the BOAddins that we require
'
Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\BCASaveAsParsedHTML")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\BCASaveAsParsedHTML", "Description", "Broadcast Agent will save the report as HTML using the WebPath you define in the document comments.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\BCASaveAsParsedHTML", "Filename", "M:\\BOAddins\\BCASaveAsParsedHTML.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\BCASaveAsParsedHTML", "Installed", 00000002, REG_DWORD)

Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ConnectNetworkDrive")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ConnectNetworkDrive", "Description", "This Add-In allows you to map network drives in your Business Objects session.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ConnectNetworkDrive", "Filename", "M:\\BOAddins\\ConnectNetworkDrive.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ConnectNetworkDrive", "Installed", 00000002, REG_DWORD)

Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SaveAsParsedHTML")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SaveAsParsedHTML", "Description", "Save Active Document as HTML for Web Page.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SaveAsParsedHTML", "Filename", "M:\\BOAddins\\SaveAsParsedHTML.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SaveAsParsedHTML", "Installed", 00000002, REG_DWORD)

Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ShowPrinters")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ShowPrinters", "Description", "This Add-in allows users to view the printer properties via control panel.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ShowPrinters", "Filename", "M:\\BOAddins\\ShowPrinters.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\ShowPrinters", "Installed", 00000002, REG_DWORD)

Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SInetDocCheck")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SInetDocCheck", "Description", "This Add-in checks for SInet universe or UQ wide universe.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SInetDocCheck", "Filename", "M:\\BOAddins\\SInetDocCheck.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\SInetDocCheck", "Installed", 00000002, REG_DWORD)

Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\UQToolsMenu")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\UQToolsMenu", "Description", "This Add-In installs the UQ Tools menu.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\UQToolsMenu", "Filename", "M:\\BOAddins\\UQToolsMenu.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\UQToolsMenu", "Installed", 00000002, REG_DWORD)


Call CreateKey   (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\WebConnect")
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\WebConnect", "Description", "Retrieves data from Internet to display in a report.", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\WebConnect", "Filename", "M:\\BOAddins\\WebConnect.rea", REG_SZ)
Call CreateValue (HKLM, "SOFTWARE\Business Objects\Suite 6.0\default\BusinessObjects\BusObj General Preferences\busobj\Options\Addin\WebConnect", "Installed", 00000002, REG_DWORD)


'************************
'Registry Functions From Here
'************************

' *****
' A quick function to search the return strings for a valuename.  Doesn't work well when it can find more than one partial match
' example 'doc' will find 'document' 'user docs' etc, but it will only display the first match it finds
' *****
Sub DisplayRegValue(strResult,strValueName)
Dim p1,p2
Dim strDisplay

  p1 = instr(strResult,strValueName)
  If p1 <> 0 Then
    p2 =instr(p1,strResult,vbcrlf)
    strDisplay = mid(strResult,p1,p2-p1)
    wscript.echo (strDisplay)
  End If

End Sub


'******************
'* Description: Registry functions Provided by the WMI StdRegProv class
'*
'* Date:           28th August 2001
'* Written by:           Andrew Mayberry
'* Email:          nessross@bigpond.com
'*
'*
'* Warning:          Use this code snippet at your own risk. Although I have
'*               tested this code in my environment, there is no guarantee
'*               implied or otherwise. Test it thoroughly in a NON-PRODUCTION
'*               environment first.
'******************



'*******************
'*     Function Name:          EnumKey
'*     Inputs:               Key, Subkey
'*     Example:           wscript.echo EnumKey(HKCU, "Software\Microsoft")
'*     Returns:          List of all sub keys
'*******************


Function EnumKey(Key, SubKey)
     Dim Ret()
     Dim MaxCount 

     oReg.EnumKey Key, SubKey, sKeys
     If Not IsNull(sKeys) Then MaxCount = UBound(sKeys) Else MaxCount = 0
     If MaxCount > 0 Then
         ReDim Ret(MaxCount)
    
         For Count = 0 To MaxCount
              Ret(Count) = sKeys(Count)
         Next
    
         EnumKey = Join(Ret, vbCrLf)
     End If
End Function

'*******************
'*     Function Name:          EnumValues
'*     Inputs:               Key, Subkey
'*     Example           wscript.echo EnumValues(HKCU, "Software\Microsoft")
'*     Returns:          List of all values in the format;
'*                         NAME,TYPE,VALUE
'*******************

Function EnumValues(Key, SubKey)
     Dim Ret()
     oReg.EnumValues Key,SubKey, sKeys, iKeyType 'fill the array
     ReDim Ret(UBound(sKeys))

     For Count = 0 to UBound(sKeys)
          Select Case iKeyType(Count)
               Case REG_SZ
                    oReg.GetStringValue Key,SubKey, sKeys(Count), sValue
                    Ret(Count) = sKeys(Count) &amp; "," &amp; "REG_SZ" &amp; "," &amp; sValue
               Case REG_EXPAND_SZ
                    oReg.GetExpandedStringValue Key,SubKey, sKeys(Count), sValue
                    Ret(Count) = sKeys(Count) &amp; "," &amp; "REG_EXPAND_SZ" &amp; "," &amp; sValue
               Case REG_BINARY
                    oReg.GetBinaryValue Key,SubKey, sKeys(Count), aValue
                    Ret(Count) = sKeys(Count) &amp; "," &amp; "REG_BINARY" &amp; "," &amp; Join(aValue,"")
               Case REG_DWORD
                    oReg.GetDWORDValue Key,SubKey, sKeys(Count), lValue
                    Ret(Count) = sKeys(Count) &amp; "," &amp; "REG_DWORD" &amp; "," &amp; lValue
               Case REG_MULTI_SZ
                    oReg.GetMultiStringValue Key,SubKey, sKeys(Count), sValue
                    Ret(Count) = sKeys(Count) &amp; "," &amp; "REG_MULTI_SZ" &amp; "," &amp; Join(sValue,"")
          End Select
     Next
     EnumValues = Join(Ret,vbCrLf)
End Function


'*******************
'*     Function Name:          CreateKey
'*     Inputs:               Key, Subkey
'*     Example           CreateKey(HKCU, "Software\KillerApp")
'*     Returns:          The error code where 0 is successful
'*******************

Function CreateKey(Key, SubKey)
     CreateKey = oReg.CreateKey(Key,SubKey)
End Function


'*******************
'*     Function Name:          CheckAccess
'*     Inputs:               Key, Subkey, AccessLevel
'*                         where AccessLevel is one of the following:
'*                              KEY_QUERY_VALUE
'*                              KEY_SET_VALUE
'*                              KEY_CREATE_SUB_KEY
'*                              KEY_ENUMERATE_SUB_KEYS
'*                              KEY_NOTIFY
'*                              KEY_CREATE_LINK
'*                              DELETE
'*                              READ_CONTROL
'*                              WRITE_DAC
'*                              WRITE_OWNER
'*
'*     Example           CheckAccess(HKCU, "Software\KillerApp", KEY_CREATE_SUB_KEY)
'*     Returns:          The error code where 0 is successful
'*******************

Function CheckAccess(Key, Subkey, AccessLevel)
     Dim Ret
     Dim bValue
     CheckAccess = False
     oReg.CheckAccess Key,SubKey,AccessLevel,bValue
     
     If bValue = -1 then
          CheckAccess = 0
     Else
          CheckAccess = -1
     End if
End Function


'*******************
'*     Function Name:          DeleteKey
'*     Inputs:               Key, Subkey
'*     Example           DeleteKey(HKCU, "Software\KillerApp")
'*     Returns:          The error code where 0 is successful
'*******************

Function DeleteKey(Key,SubKey)
     DeleteKey = oReg.DeleteKey(Key,SubKey)
End Function


'*******************
'*     Function Name:          DeleteValue
'*     Inputs:               Key, Subkey, ValueName
'*     Example           DeleteValue(HKCU, "Software\KillerApp","SomeSetting")
'*     Returns:          The error code where 0 is successful
'*******************

Function DeleteValue(Key, SubKey, ValueName)
     DeleteValue = oReg.DeleteValue(Key,SubKey,ValueName)
End Function

'*******************
'*     Function Name:          CreateValue
'*     Inputs:               Key,SubKey,ValueName,Value,KeyType
'*     Example           CreateValue(HKCU, "Software\KillerApp","SomeSetting","Hello World",REG_SZ)
'*     Returns:          The error code where 0 is successful
'*******************

Function CreateValue(Key,SubKey,ValueName,Value,KeyType)
     Select Case KeyType
          Case REG_SZ
               CreateValue = oReg.SetStringValue(Key,SubKey,ValueName,Value)
          Case REG_EXPAND_SZ
               CreateValue = oReg.SetExpandedStringValue(Key,SubKey,ValueName,Value)
          Case REG_BINARY
               CreateValue = oReg.SetBinaryValue(Key,SubKey,ValueName,Value)
          Case REG_DWORD
               CreateValue = oReg.SetDWORDValue(Key,SubKey,ValueName,Value)
          Case REG_MULTI_SZ
               CreateValue = oReg.SetMultiStringValue(Key,SubKey,ValueName,Value)
     End Select
End Function


Hayden_Gill :australia: (BOB member since 2002-08-15)

Hi Hayden

Thank you for sharing this code!


irish_stan :ireland: (BOB member since 2003-05-13)

For our Citrix users we just map a network drive P: for everyone. BO can’t tell the difference, it’s SAN so it’s fast enough, and it gets set up each time someone logs in so P:\personal\user docs\ always goes to the right place. If you stay away from UNC names the whole thing is pretty clean and easy.

Cris E
St Paul, MN


Cris E :us: (BOB member since 2005-03-18)

Of course now that I look I see we’ve only got our 5.x stuff on Citrix. As Emily Litella used to say, “Never mind.”

Cris E
St Paul, MN


Cris E :us: (BOB member since 2005-03-18)