Link to home
Start Free TrialLog in
Avatar of mostabdo
mostabdoFlag for Egypt

asked on

How to use Run as command in a script

My current environment is windows 7 workstations and windows server 2003 DC and servers.
All domain users are just users with no Administrators privilege.

I need to creat a batch file that add reg key in registries, this batch should run in  machine start uo through group policy.

The problem is that i need this batch with Admin rights so it can access the registry editor.

How can i use the local administrator account to run this batch ???

I am fliexible to use any language of scripting just advice with the commands
Avatar of sujithmd
sujithmd
Flag of India image

SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mostabdo

ASKER

Well...thank you so much for explanation...I need to add a key to theHKLM, i used the below command in batch file (AA.bat)

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\NonEnum /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 00000001 /f

So i will add the AA.bat to the startup script and the machine should apply it without problems ..is it right??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"If you're already managing your policies from W2k8/Win7,"


Then you dont need any custom ADM, ADMX or ADML files....You would use GPP
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The whole point of GPP is to rid of registry edits, scripts, and importing templates! I'm sure everyone's "Preference" would be to do it the easier way.