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: Admin rights for batch


16 Aug 2010   #1

Windows 7
 
 
Admin rights for batch

I got a batch script which needs Admin privileges.
For example it installs some Programmes or move/copy files to/from System directories.

So on Windows 7 (and Vista) I can say "Run as" and I got a Message like "are you sure allowing ... bla" OK/Cancel?
But how I can get arround this MSG-Box?
How can I place the Admin Name/PW in the Batchfile? (a runas cmd i allready tried seems to don't work)


My System SpecsSystem Spec
.

16 Aug 2010   #2

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

As far as I am aware you are asking the impossible., or at least the stupendously difficult

You can however turn off UAC prompts completely so you just have to do Run as Administrator and it's done.

Another neat trick is start a program from within an elevated program (such as a dock); all programs opened using an elevated program themselves are automatically elevated .

Oli
My System SpecsSystem Spec
16 Aug 2010   #3

Win7 Home Premium 64x
 
 

Crtl+Shift+Mouse Click will launch the app with admin priveledges.

Otherwise, you can make a shortcut to the .bat file that has admin priveledges through this tut:

Elevated Program Shortcut without UAC Prompt - Create
My System SpecsSystem Spec
.


16 Aug 2010   #4

MAC OS X v10.4.10
 
 

I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
My System SpecsSystem Spec
16 Aug 2010   #5

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

Quote   Quote: Originally Posted by StuberB View Post
I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
Please correct me if I am wrong but I believe you are confusing two different things.

Permissions &

Elevated verification (UAC, it's a security feature).

He already owns the file, Windows is just insisting that to run it as an Administrator you have to go through a UAC prompt.

Since Vista all normal command prompt Windows have been with normal user privileges only unless you specify to open it as an Admin (yet another security feature).

I hope this clears things up, and if I've got anything wrong please correct me .

Oli
My System SpecsSystem Spec
16 Aug 2010   #6

MAC OS X v10.4.10
 
 

I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
My System SpecsSystem Spec
16 Aug 2010   #7

Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
 
 

Quote   Quote: Originally Posted by StuberB View Post
I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
Don't worry, we all make mistakes. As long as you learn from them it's fine .

Have a nice day/night.

Oli
My System SpecsSystem Spec
Reply

 Admin rights for batch




Thread Tools



Similar help and support threads for2: Admin rights for batch
Thread Forum
Solved Admin rights General Discussion
admin user lost some admin rights BSOD Help and Support
e/u has local admin rights but he still gets need admin rights message Network & Sharing
Solved Why does every app need admin rights? General Discussion
Admin rights and .exe General Discussion
Batch files and admin rights on a domain System Security
No admin rights General Discussion

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 12:22 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