Solved Batch file requests privileges

akhenax

New member
Local time
8:19 PM
Messages
22
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

OS
Windows 7 32bit Enterprise
Update: I gave users 'Full Control' of the batch script, and the UAC still pops up requesting a password.
 

My Computer

OS
Windows 7 32bit Enterprise
What is the batch file supposed to do?

The code you're using will prove helpful.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
it deletes a registry key in HKLU
 

My Computer

OS
Windows 7 32bit Enterprise
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Yes, HKCU, I always do that :D. 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

OS
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 Computer

OS
Windows 7 32bit Enterprise
Back
Top