Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch file requests privileges


10 Aug 2011   #1

Windows 7 32bit Enterprise
 
 
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 System SpecsSystem Spec
.

10 Aug 2011   #2

Windows 7 32bit Enterprise
 
 

Update: I gave users 'Full Control' of the batch script, and the UAC still pops up requesting a password.
My System SpecsSystem Spec
10 Aug 2011   #3

Windows 8.1 Pro RTM x64
 
 

What is the batch file supposed to do?

The code you're using will prove helpful.
My System SpecsSystem Spec
.


10 Aug 2011   #4

Windows 7 32bit Enterprise
 
 

it deletes a registry key in HKLU
My System SpecsSystem Spec
10 Aug 2011   #5

Windows 8.1 Pro RTM x64
 
 

You mean HKCU ?

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

Does the batch file do anything else?
My System SpecsSystem Spec
10 Aug 2011   #6

Windows 7 32bit Enterprise
 
 

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 System SpecsSystem Spec
10 Aug 2011   #7

Windows 7 32bit Enterprise
 
 

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 System SpecsSystem Spec
Reply

 Batch file requests privileges




Thread Tools




Our Sites

Site Links

About Us

Find 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 08:09 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33