Batch file requests privileges


  1. Posts : 22
    Windows 7 32bit Enterprise
       #1

    Batch file requests privileges


    Greetings, I have a batch file created under the administrator account. The file is in the registry to "runonce". For a user with no password, the batch file runs fine. For a user with a password, the batch file requests the user's password that is logged on. Any idea why this happens? I would have expected the batch to run without needing the password of the user that is currently logged in.

    The permissions are System and Administrators have full control, and users have 'Read and Execute' and 'Read'. The ID in question is a standard user. Thanks
      My Computer


  2. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #2

    Update: I gave users 'Full Control' of the batch script, and the UAC still pops up requesting a password.
      My Computer


  3. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #3

    What is the batch file supposed to do?

    The code you're using will prove helpful.
      My Computer


  4. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #4

    it deletes a registry key in HKLU
      My Computer


  5. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #5

    You mean HKCU ?

    Is it the same key for each user, and what is this key?

    Does the batch file do anything else?
      My Computer


  6. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #6

    Yes, HKCU, I always do that . I create the key in the administrator account, then Sysprep. Sysprep copies the profile, along with the registry key that points to a batch file to delete another registry key that gets created incorrectly during the profile copying. I know it seems a round about way to do this, but it works for the time being. The Regedit brings up the UAC for any account you login using a password.
      My Computer


  7. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #7

    Found another way to do it. Just add the registry entry in the sysprep setup xml file like so:
    <FirstLogonCommands>
    <SynchronousCommand wcm:action="add">
    <CommandLine>REG ADD HKLM\Software\microsoft\windows\currentversion\runonce /v IUB /t Reg_SZ /d C:\mycommand.bat</CommandLine>
    <Order>1</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    </FirstLogonCommands>
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:45.
Find Us