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: Run elevated ("Run As Administrator") automatically in .BAT .CMD file


27 May 2011   #1

Windows 7 Ultimate x32
 
 
Run elevated ("Run As Administrator") automatically in .BAT .CMD file

Hello,

I've prepared an unattended Windows 7 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 System SpecsSystem Spec
.

27 May 2011   #2

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 System SpecsSystem Spec
27 May 2011   #3

Windows 7 Ultimate x32
 
 

Got success HERE
My System SpecsSystem Spec
.


02 Jul 2011   #4

Windows 7 Home premium x64
 
 

The winrar sfx can also run anything with admin rights you can select this in sfx options...
My System SpecsSystem Spec
Reply

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




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 07:24 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