Scripts Thread, My Documents script not working on R2 in Coding and Web Development; I'm popping this in Scripts as the problem is being caused by a login script that I have working perfectly ...
10th June 2008, 04:54 PM #1
My Documents script not working on R2
I'm popping this in Scripts as the problem is being caused by a login script that I have working perfectly on three other setups but for some reason it wants nothing to do with me on this setup.
The only difference is that this server is an R2 version of Win2k3 and there seem to be some significant differences relating to the folder redirection and I'm guessing a security change somewhere too.
Anyway the script is attached... if someone could give it a look over and see if they can spot why it's getting this error:
What I'm trying to do is setup a number of shares and get one of them to be the "My Documents" by default but it just doesn't want to stick.
Invalid root in registry key "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Explorer\Shell Folders\Personal"
This is with a client that has WinXPSP2.
Interestingly enough it seems that looking at the resultant policy wizard results.. the computer is NOT losing the My Documents redirect I tried at one point too... Deleting the initial policy seems to make lilttle difference.
Can anyone help this is driving me round the flippin bend!!
10th June 2008, 05:09 PM #2
Just a suggestion shouldn't there be a backslash in there after the drive name
you could possibly just map it using the UNC path from your other variable instead as another option:
path1 = "H:\"
path2 = path1 & "My Pictures"
path1 = strUserFolder
10th June 2008, 05:14 PM #3
Looks like this error message gets thrown up when the reg key does not exist.
Verify registry key exists
I am writing a script to verify that a registry key exists. The script works fine and gives me the information I need if the key exists, but if the key does not exists the script errors out on me. The error I get is INVALID ROOT IN REGISTRY KEY.
I usually just use folder redirection in a GPO for this as it is a pretty robust method.
Last edited by SYNACK; 10th June 2008 at 05:16 PM.
10th June 2008, 05:16 PM #4
It's actually looking like it's a permissions error... or at least that's what happens when I try to run the script manually...
When the script runs as part of a login routine it doesn't even manage to map everything properly... I think that may be related to something else though... one sec.
10th June 2008, 05:20 PM #5
Ah... think it may be a permissions issue with something else..
If I try to set the target manually I get "The location you requested is not allowed as a target."
10th June 2008, 05:25 PM #6
Why do you not use group policy?
10th June 2008, 05:25 PM #7
That would make sence, to the script it would look like simply be an unaccessible location and so would throw the error. You should be able to reset the permissions on that key to allow testing, just need to right click on the key in regedit and click permissions.
10th June 2008, 05:37 PM #8
Tied it down further... this is only affecting users that have a profile that pre-existed and had to be reset with perms. That means I must have bollixed up something in the permissions there...
Hmm... It's probably an old gpo setting in there or something equally as sodding annoying...
10th June 2008, 05:43 PM #9
10th June 2008, 06:05 PM #10
Well I thought I'd got it... Now WTF is going on??!!
10th June 2008, 06:20 PM #11
Missed this earlier... because I have a system for doing this stuff (which has worked to date).,.. plus I've tried using group policy and it still borks, falls over and kicks the baby out with the bath water.
Originally Posted by FN-Greatermanchester
This is weird... trying to figure out why one account works when the others don't is just nuts.
10th June 2008, 06:22 PM #12
Sorry just to double check the client is SP2 not 3?
10th June 2008, 07:09 PM #13
10th June 2008, 07:10 PM #14
Yeah... it's definitely SP2... it could be that a "Fix" got in there though... either way, as I said, I took the easy way out.
Originally Posted by FN-Greatermanchester
10th June 2008, 10:22 PM #15
I very much doubt that permissions on the folder you are redirecting to would prevent the script from writing to the registry.
If it's just the 'Shell Folders' key that is erroring out, you could try skipping it altogether. The Technet article here (Windows Confidential: The Sad Story of the Shell Folders Key) states that the 'Shell Folders' key is only there for compatibility reasons for a few bad apps.
Thanks to ajbritton from:
By ctote in forum Windows
Last Post: 18th April 2008, 08:49 AM
By FN-GM in forum Scripts
Last Post: 27th March 2008, 05:57 PM
By sradams1977 in forum Scripts
Last Post: 29th December 2007, 11:53 PM
By SwedishChef in forum Scripts
Last Post: 5th July 2006, 09:14 AM
By secman in forum Windows
Last Post: 14th February 2006, 12:56 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)