Hi there,
I am creating a script so that it edit the local registry to set the office templates location to a point on the server. I have this so far:
If I am not mistaken that located the key and changes it to 'Insert location here'.
Could someone help out by suggesting how I would go about to do the following:
I would like the script to read the key and if it is already 'Insert location here' to ignore and continue. However, if it isn't 'Insert..' to change it to 'Insert..'
Advice would be appricated. I'm not v.good at programming and I think I am getting a little confused.
Cheers.
I am creating a script so that it edit the local registry to set the office templates location to a point on the server. I have this so far:
Code:
'Connect to machines registry
Set WshShell = CreateObject( "WScript.Shell" )
regLocation = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\templates"
WshShell.RegWrite regLocation,"Insert Location here","REG_SZ"
'---------
'Check if Registry Key exists.
Const HKEY_CURRENT_USER = &H80000001
strKeyPath = "SOFTWARE\Microsoft\Office\11.0\Common\General"
strValueName = "Templates"
If strValue = "Insert Location here" then end
End If
If I am not mistaken that located the key and changes it to 'Insert location here'.
Could someone help out by suggesting how I would go about to do the following:
I would like the script to read the key and if it is already 'Insert location here' to ignore and continue. However, if it isn't 'Insert..' to change it to 'Insert..'
Advice would be appricated. I'm not v.good at programming and I think I am getting a little confused.
Cheers.