none
Setting a HKCU values for a user other than Administrator

    Question

  • Hello,

    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

    Monday, February 4, 2008 9:48 PM

Answers

  • 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

    Saturday, February 9, 2008 5:34 AM

All replies

  • 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

     

    Tuesday, February 5, 2008 3:31 AM
  • I 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

    Tuesday, February 5, 2008 3:54 AM
  • 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

    Friday, February 8, 2008 7:32 PM
  • 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.

    Friday, February 8, 2008 7:36 PM
  • Try opening up  a command window and cd to a UNC path.

    Problem still applies.

    Cheers,

    Ilya

    Friday, February 8, 2008 8:50 PM
  • Exactly. 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

    Friday, February 8, 2008 8:58 PM
  • 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.

    Friday, February 8, 2008 11:56 PM
  • I 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

    Saturday, February 9, 2008 12:06 AM
  • 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.

    Saturday, February 9, 2008 5:19 AM
  • 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

    Saturday, February 9, 2008 5:34 AM