Setting a HKCU values for a user other than Administrator
-
lunedì 4 febbraio 2008 21:48Hello,
I had a post earlier about Python and UNC paths and found a registry setting that fixes it.
http://support.microsoft.com/kb/156276
The only thing is that the registry setting is HKCU and I can only edit it for the Administrator. I made the same change under HKU for the sid of the user but am still unable to use UNC paths as the user, but only as Administrator. How does the HKCU get improted to the nodes when running as a user? I am using active directory.
Thanks,
Ilya
Tutte le risposte
-
martedì 5 febbraio 2008 03:31
Hi,
It sounds like you want to make this a system wide change. If that's the case I'd recommend making the change to HKEY_LOCAL_MACHINE instead of HKCU. I haven't verified this will work for this particular UNC issue but it making the change in HKLM should change system wide functionality and affect all users.
ryan
-
martedì 5 febbraio 2008 03:54I tried to change HKLM and did not work. You can reproduce this issues quite easily for your testing purposes.
Submit the following python script to the cluster. Set the currentdirectory for the job to be a UNC path.
import os
os.system('Dir')
Thanks,
Ilya -
venerdì 8 febbraio 2008 19:32
I’m a little confused. Have you tried setting the working directory to a UNC path as part of the job submitted to the Compute Cluster Server job scheduler? Did that fail?
Ryan Waite
-
venerdì 8 febbraio 2008 19:36
If you look at the "Applies to" section of that KB article, it's actually quite old. It doesn't look like this should still be an issue on Windows Server 2003.
I suspect whatever problem you are encoutnering is unrelated to the probelm described in that article.
-
venerdì 8 febbraio 2008 20:50Try opening up a command window and cd to a UNC path.
Problem still applies.
Cheers,
Ilya -
venerdì 8 febbraio 2008 20:58Exactly. Set the working directorty to a UNC path.
then submit the follwoing python script
import os
os.system('Dir')
You will see the same error.
Thanks,
Ilya -
venerdì 8 febbraio 2008 23:56
I see what you're doing. You're seeing something like this:
C:\Users\ryanw>cd \\server\share
'\\server\share'
CMD does not support UNC paths as current directories.C:\Users\ryanw>
That's just the way the Windows command prompt works. PowerShell works differently and will allow you to change the working directory to a network share. You might try using PowerShell.
Another option is to map a drive and change to the drive letter. That can be a little messy if you have other mapped drives but the idea is to do this:
C:\Users\ryanw>net use Z: \\server\share
The command completed successfully.
C:\Users\ryanw>z:Z:\>
Anyway, I'd recommend trying out PowerShell. It supports all the standard Windows command prompt stuff and more.
-
sabato 9 febbraio 2008 00:06I am not directly using cmd.exe. When running a python script using the job scheduler and execute os.system('executable'), os.system invokes cmd.exe to run the executable. If I have my WD set \\server\share as I do in the job scheduler, then it does not find my working directory and my job fails . If I make the chages as suggested in the KB article, it works for Admin but not for Users. I am currently running jobs as Admin which I would prefer not to do.
I don't want to hard mount a directory on 32 nodes. That would be a pain.
Cheers,
Ilya -
sabato 9 febbraio 2008 05:19
I’m struggling with this since I only have W2K8 installed in my office. With W2K8 I can’t get CMD to allow me to “cd” into a UNC path, even with the registry key set.
I have two recommendations:
1. Try this with PowerShell. That works fine over here. I haven’t tried it with Python.
2. Post to a scripting focused newsgroup like those at: http://www.microsoft.com/technet/community/newsgroups/topics/scripting.mspx
Wish I had a better answer but I think the scripting folks should be able to nail this one.
-
sabato 9 febbraio 2008 05:34
I still can't cd to a UNC path even as administrator but I can lauch a python script with the job scheduler where the WD is set to a UNC path, but only as administrator, when I make the registry changes. I am not so much interested in cd to a UNC path using CMD, but to be able to submit python scripts using the job scheduler.
Thanks for the input.
Ilya- Contrassegnato come risposta Don PatteeModerator mercoledì 25 marzo 2009 23:38