Solved Run elevated ("Run As Administrator") automatically in .BAT .CMD file

coucou

New member
Local time
11:19 PM
Messages
13
Run elevated ("Run As Administrator") automatically in .BAT .CMD file

Hello,

I've prepared an unattended Win7 SP1 DVD, everything works just fine except a part of my registry tweaks (>100) MyTweaks.reg. After investigation, it proved that those registries must be run elevated ("Run As Administrator").

Here bellow, MyTweaks.bat. What to add/modify to make REGEDIT elevated runnig? Otherwise, is there a .cmd command abble doing that?
Code:
@ECHO OFF
ECHO.
REGEDIT /S "%systemroot%\Setup\Scripts\MyTweaks.reg"
EXIT
Regards
 

My Computer

OS
Windows 7 Ultimate x32
I find that nircmd.exe from nirsoft can do easealy the job
Code:
Nircmd\NIRCMD.exe elevate REG import C:\Windows\Setup\Scripts\MyTweaks.reg

But still the following registries are NOT applied.

Code:
; Remove Control Panel from the Windows 7 Explorer Navigation Panel
[HKEY_CLASSES_ROOT\CLSID\{26EE0668-A00A-44D7-9371-BEB064C98683}\ShellFolder]"Attributes"=dword:a0900004
;--------------------------------------------------------------------------------
; Remove Favorites from the Windows 7 Explorer Navigation Panel
[HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]"Attributes"=dword:a9400100
On reflection, I noticed that the problem is NOT (or not only) run elevate. It's the Permissions forAdministrators group Full Control box not cheked Allow step 5 HERE.
Is there any how to do that automatically?

Regards
 

My Computer

OS
Windows 7 Ultimate x32
The winrar sfx can also run anything with admin rights you can select this in sfx options...
 

My Computer

Computer Manufacturer/Model Number
Sony Vaio
OS
Windows 7 Home premium x64
CPU
Intel i5 520m at 2.4GHz(plus turbo mode at 2.9GHz)
Memory
4GB ddr3 1067
Graphics Card(s)
Nvidia 330m
Back
Top